Skip to content

Diagnostic for conflicting declared attribute types #206

@sharkdp

Description

@sharkdp

We should emit a diagnostic when we see conflicting declared types of attributes, either between the declaration in the class body and declarations in a method, or between annotated assignments in different methods. We have existing tests for this scenario (see TODO comments):

https://github.com/astral-sh/ruff/blob/eb08345fd5434ed3db243233df6dd91757a6af3b/crates/red_knot_python_semantic/resources/mdtest/attributes.md?plain=1#L212-L226

part of: astral-sh/ruff#14164

Metadata

Metadata

Assignees

No one assigned

    Labels

    attribute accessInstance attributes, class attributes, etc.help wantedContributions especially welcometyping semanticstyping-module features, spec compliance, etc

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions