mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-02 22:55:08 +00:00

We mostly keep things the same here, but the message has been moved from the annotation to the diagnostic's top-line message. I think this is perhaps a little worse, but some bigger improvements could be made here. Indeed, we could perhaps even add a "fix" here.
223 B
223 B
Classes shadowing
Implicit error
class C: ...
C = 1 # error: "Implicit shadowing of class `C`"
Explicit
No diagnostic is raised in the case of explicit shadowing:
class C: ...
C: int = 1