Merge remote-tracking branch 'origin/python-qual-subclass-shadow' into python-qual-subclass-shadow

This commit is contained in:
Joe Farebrother
2025-08-01 12:39:30 +01:00
2 changed files with 2 additions and 2 deletions

View File

@@ -64,7 +64,7 @@ where
if isProperty(shadowed)
then
// it's not a setter, so it's a read-only property
extra = " (read-only property may cause an error if written to in the superclass.)"
extra = " (read-only property may cause an error if written to in the superclass)"
else extra = ""
)
select shadowed, "This method is shadowed by $@ in superclass $@." + extra, write,

View File

@@ -2,7 +2,7 @@ class A:
def __init__(self):
self._foo = 3
class B:
class B(A):
# BAD: _foo is shadowed by attribute A._foo
def _foo(self):
return 2