File tree Expand file tree Collapse file tree 1 file changed +25
-3
lines changed
Expand file tree Collapse file tree 1 file changed +25
-3
lines changed Original file line number Diff line number Diff line change @@ -3624,9 +3624,31 @@ t2.foo = [1] # E: Value of type variable "T" of "foo" of "Test" cannot be "int"
36243624[builtins fixtures/property.pyi]
36253625
36263626[case testMissingTypeArgsInApplication]
3627- x: list[()] = [] # E: "list" expects 1 type argument, but none given
3627+ from typing import Generic
3628+ from typing_extensions import Unpack, TypeVarTuple
3629+
3630+ Ts = TypeVarTuple("Ts")
3631+
3632+ class CanHaveZero(Generic[Unpack[Ts]]): ...
3633+
3634+ ok1: CanHaveZero[()]
3635+ ok2: tuple[()]
3636+
3637+ bad1: list[()] = [] # E: "list" expects 1 type argument, but none given
3638+ [builtins fixtures/tuple.pyi]
36283639
36293640[case testMissingTypeArgsInApplicationStrict]
36303641# flags: --strict
3631- x: list[()] = [] # E: "list" expects 1 type argument, but none given \
3632- # E: Missing type arguments for generic type "list"
3642+ from typing import Generic
3643+ from typing_extensions import Unpack, TypeVarTuple
3644+
3645+ Ts = TypeVarTuple("Ts")
3646+
3647+ class CanHaveZero(Generic[Unpack[Ts]]): ...
3648+
3649+ ok1: CanHaveZero[()]
3650+ ok2: tuple[()]
3651+
3652+ bad1: list[()] = [] # E: "list" expects 1 type argument, but none given \
3653+ # E: Missing type arguments for generic type "list"
3654+ [builtins fixtures/tuple.pyi]
You can’t perform that action at this time.
0 commit comments