We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 46abe18 commit f2c6d32Copy full SHA for f2c6d32
test-data/unit/check-selftype.test
@@ -351,6 +351,20 @@ class E:
351
def __init_subclass__(cls) -> None:
352
reveal_type(cls) # E: Revealed type is 'def () -> __main__.E'
353
354
+[case testSelfTypePropertyUnion]
355
+from typing import Union
356
+class A:
357
+ @property
358
+ def f(self: A) -> int: pass
359
+
360
+class B:
361
362
+ def f(self: B) -> int: pass
363
+x: Union[A, B]
364
+reveal_type(x.f) # E: Revealed type is 'builtins.int'
365
366
+[builtins fixtures/property.pyi]
367
368
[case testSelfTypeProperSupertypeAttribute]
369
from typing import Callable, TypeVar
370
T = TypeVar('T', bound=object)
0 commit comments