Skip to content

Commit a0b3773

Browse files
committed
Better test
1 parent 22307d9 commit a0b3773

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

test-data/unit/check-flags.test

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2740,16 +2740,23 @@ disallow_redefinition = true
27402740

27412741
[case testRevealSimpleTypes]
27422742
# flags: --reveal-simple-types
2743+
from typing import Generic, TypeVar
27432744
from typing_extensions import TypeVarTuple, Unpack, TypedDict
27442745

2746+
T = TypeVar("T", bound=int)
2747+
S = TypeVar("S", default=list[T])
2748+
2749+
class A(Generic[T, S]): ...
2750+
reveal_type(A) # N: Revealed type is "def [T <: int, S = list[T]] () -> A[T, S]"
2751+
27452752
Ts = TypeVarTuple("Ts")
27462753
def foo(x: int, *xs: Unpack[Ts]) -> tuple[int, Unpack[Ts]]: ...
27472754
reveal_type(foo) # N: Revealed type is "def [Ts] (x: int, *xs: *Ts) -> tuple[int, *Ts]"
27482755

2749-
class Options(TypedDict):
2750-
rate: int
2751-
template: str
2756+
class User(TypedDict):
2757+
age: int
2758+
name: str
27522759

2753-
def bar(x: int, **kwargs: Unpack[Options]) -> None: ...
2754-
reveal_type(bar) # N: Revealed type is "def (x: int, **kwargs: **TypedDict(Options, {'rate': int, 'template': str}))"
2760+
def bar(x: int, **kwargs: Unpack[User]) -> None: ...
2761+
reveal_type(bar) # N: Revealed type is "def (x: int, **kwargs: **TypedDict(User, {'age': int, 'name': str}))"
27552762
[builtins fixtures/tuple.pyi]

0 commit comments

Comments
 (0)