Skip to content

Commit a56fcac

Browse files
authored
Add test cases for method property overrides (#13503)
1 parent 9431d47 commit a56fcac

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test-data/unit/check-classes.test

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7457,3 +7457,23 @@ class Bar(Foo):
74577457
@x.setter
74587458
def x(self, value: int) -> None: ...
74597459
[builtins fixtures/property.pyi]
7460+
7461+
[case testOverrideMethodProperty]
7462+
class B:
7463+
def foo(self) -> int:
7464+
...
7465+
class C(B):
7466+
@property
7467+
def foo(self) -> int: # E: Signature of "foo" incompatible with supertype "B"
7468+
...
7469+
[builtins fixtures/property.pyi]
7470+
7471+
[case testOverridePropertyMethod]
7472+
class B:
7473+
@property
7474+
def foo(self) -> int:
7475+
...
7476+
class C(B):
7477+
def foo(self) -> int: # E: Signature of "foo" incompatible with supertype "B"
7478+
...
7479+
[builtins fixtures/property.pyi]

0 commit comments

Comments
 (0)