We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
testOverrideWithPropertyDecorator
1 parent 834e125 commit 0060334Copy full SHA for 0060334
test-data/unit/check-classvar.test
@@ -269,6 +269,19 @@ class A(metaclass=ABCMeta):
269
class B(A):
270
x = 0 # type: ClassVar[int]
271
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
285
[case testAcrossModules]
286
import m
287
reveal_type(m.A().x)
0 commit comments