Skip to content

Have multiple passes by SemanticAnalyzerPass3 to resolve more forward references. #4095

Closed
@ilevkivskyi

Description

@ilevkivskyi

As mentioned in #3952 (comment) some double-forward references (and other corner cases) are currently not resolved. For example this does not work:

x: A
A = B
B = List[int]

This is because third pass happens only once. In checker.py we have deferred nodes, and there are mini-passes over them until they are all done, I think we can adopt the same idea here and have repeated third passes.

This is however low priority since these edge cases are extremely rare and don't cause crashes, only false positives.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions