Skip to content

Commit f2c6d32

Browse files
committed
demonstrate the need for meet
1 parent 46abe18 commit f2c6d32

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test-data/unit/check-selftype.test

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,20 @@ class E:
351351
def __init_subclass__(cls) -> None:
352352
reveal_type(cls) # E: Revealed type is 'def () -> __main__.E'
353353

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+
@property
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+
354368
[case testSelfTypeProperSupertypeAttribute]
355369
from typing import Callable, TypeVar
356370
T = TypeVar('T', bound=object)

0 commit comments

Comments
 (0)