Skip to content

New semantic analyzer: Support idem forward aliases #6404

Closed
@ilevkivskyi

Description

@ilevkivskyi

This is a follow-up for #6390

This tricky corner case is used in some real code and is supported by old semantic analyzer

C = C
class C:  # type: ignore
    pass

x: C

But with new analyzer this results in Invalid type since the first definition always wins. Probably we just need to special-case this somehow.

Metadata

Metadata

Assignees

Labels

bugmypy got something wrongfalse-positivemypy gave an error on correct codepriority-0-highsemantic-analyzerProblems that happen during semantic analysis

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions