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.
228 B
228 B
Shadowing
Implicit class shadowing
class C: ...
C = 1 # error: [invalid-assignment]
Implicit function shadowing
def f(): ...
f = 1 # error: [invalid-assignment]