-
-
Save mrahtz/cc86c29538de1d4a80a2e8958ae71c5a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import Any, Generic, TypeVar | |
from pyre_extensions import TypeVarTuple, Unpack | |
Ts = TypeVarTuple('Ts') | |
class C(Generic[Unpack[Ts]]): | |
pass | |
Ts1 = TypeVarTuple('Ts1') | |
Ts2 = TypeVarTuple('Ts2') | |
Foo = tuple[C[Unpack[Ts1]], C[Unpack[Ts2]]] | |
t: Foo[int, str] | |
reveal_type(t) | |
""" | |
ƛ Found 3 type errors! | |
test.py:13:3 Invalid type variable [34]: The type variable `Ts1` can only be used to annotate generic classes or functions. | |
test.py:13:3 Invalid type variable [34]: The type variable `Ts2` can only be used to annotate generic classes or functions. | |
test.py:14:0 Revealed type [-1]: Revealed type for `t` is `typing.Any`. | |
""" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment