Skip to content

GDForStatement doesn't parse qualified type annotations (e.g. ClassName.EnumName) #19

Description

@dreed-sd

When a for-loop variable has a qualified type annotation containing a dot (e.g. ClassName.EnumName), the parser only captures the first identifier as the VariableType and the .EnumName portion leaks into the Collection expression.

as in:

for t: MyClass.MyEnum in some_array:
    pass

Expected AST:

  • Variable = t
  • VariableType = GDSubTypeNode with OverType = MyClass, Type = MyEnum
  • Collection = some_array

Actual AST:

  • Variable = t
  • VariableType = GDSingleTypeNode("MyClass")
  • Collection = .MyEnum in some_array

Tested on LSP branch

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions