Skip to content

Parse error when annotation and a const variable are on the same line #329

Description

@fstxz

Input:

func test_warnings():
	@warning_ignore("unused_local_constant") const unused_local_constant = 1

Error: the input GDScript code contains parse errors

This code is fine:

func test_warnings():
	@warning_ignore("unused_local_constant") var unused_local_constant = 1

This is also fine (but it gets formatted into the input code and you get the same error when formatting again):

func test_warnings():
	@warning_ignore("unused_local_constant")
	const unused_local_constant = 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    upstreamThe issue (likely) can't be solved in this repository: a library needs a change

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions