File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -886,9 +886,8 @@ def analyze_var(
886886 if isinstance (typ , FunctionLike ) and not typ .is_type_obj ():
887887 call_type = typ
888888 elif var .is_property :
889- call_type = get_proper_type (
890- _analyze_member_access ("__call__" , typ , mx .copy_modified (self_type = typ ))
891- )
889+ deco_mx = mx .copy_modified (original_type = typ , self_type = typ , is_lvalue = False )
890+ call_type = get_proper_type (_analyze_member_access ("__call__" , typ , deco_mx ))
892891 else :
893892 call_type = typ
894893
Original file line number Diff line number Diff line change @@ -2819,6 +2819,8 @@ class Child(Base):
28192819 @decorator
28202820 def foo(self) -> int:
28212821 return 42
2822+ reveal_type(Child().foo) # N: Revealed type is "builtins.int"
2823+ Child().foo = 1 # E: Property "foo" defined in "Child" is read-only
28222824
28232825reveal_type(Child().foo) # N: Revealed type is "builtins.int"
28242826
@@ -2835,14 +2837,13 @@ class not_a_decorator:
28352837 def __init__(self, fn): ...
28362838
28372839class BadChild2(Base):
2840+ # Override error not shown as accessing 'foo' on BadChild2 returns Any.
28382841 @property
28392842 @not_a_decorator
2840- def foo(self) -> int: # E: Signature of "foo" incompatible with supertype "Base" \
2841- # N: Superclass: \
2842- # N: int \
2843- # N: Subclass: \
2844- # N: not_a_decorator
2843+ def foo(self) -> int:
28452844 return 42
2845+ reveal_type(BadChild2().foo) # E: "not_a_decorator" not callable \
2846+ # N: Revealed type is "Any"
28462847[builtins fixtures/property.pyi]
28472848
28482849[case explicitOverride]
You can’t perform that action at this time.
0 commit comments