Skip to content

Detect and flag as errors forward references to variables #6303

@ilevkivskyi

Description

@ilevkivskyi

With the old semantic analyzer this code is an error:

def func() -> None:
    x
    x = 1

We should also flag it as an error in the new semantic analyzer (ideally also at module scope but it doesn't work currently and there is a separate issue).

This is a follow-up for #6280

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions