File tree 2 files changed +6
-3
lines changed
2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -2285,10 +2285,11 @@ def check_method_override_for_base_with_name(
2285
2285
isinstance (original_node , Var )
2286
2286
and original_node .is_classvar
2287
2287
and defn .name == original_node .name
2288
- and isinstance (defn , Decorator )
2288
+ and ( isinstance (defn , ( Decorator , OverloadedFuncDef )) )
2289
2289
):
2290
2290
self .fail (
2291
- message_registry .CANNOT_OVERRIDE_CLASS_VAR .format (base .name ), defn .func
2291
+ message_registry .CANNOT_OVERRIDE_CLASS_VAR .format (base .name ),
2292
+ defn .func if isinstance (defn , Decorator ) else defn .items [0 ].func ,
2292
2293
)
2293
2294
2294
2295
if (
Original file line number Diff line number Diff line change @@ -277,10 +277,12 @@ class A:
277
277
class B(A):
278
278
@property
279
279
def x(self) -> int: ...
280
+
281
+ @x.setter
282
+ def x(self, value: int) -> None: ...
280
283
[builtins fixtures/property.pyi]
281
284
[out]
282
285
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
286
285
287
[case testAcrossModules]
286
288
import m
You can’t perform that action at this time.
0 commit comments