Skip to content

Commit 0060334

Browse files
committed
test: add testOverrideWithPropertyDecorator unit test
1 parent 834e125 commit 0060334

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Diff for: test-data/unit/check-classvar.test

+13
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,19 @@ class A(metaclass=ABCMeta):
269269
class B(A):
270270
x = 0 # type: ClassVar[int]
271271

272+
[case testOverrideWithPropertyDecorator]
273+
from typing import ClassVar
274+
275+
class A:
276+
x: ClassVar[int]
277+
class B(A):
278+
@property
279+
def x(self) -> int: ...
280+
[builtins fixtures/property.pyi]
281+
[out]
282+
main:7: error: Cannot override class variable (previously declared on base class "A") with instance variable
283+
main:7: error: Cannot override writeable attribute with read-only property
284+
272285
[case testAcrossModules]
273286
import m
274287
reveal_type(m.A().x)

0 commit comments

Comments
 (0)