Skip to content

Commit 19506aa

Browse files
committed
add a call to generic class in test case
1 parent cbf9999 commit 19506aa

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test-data/unit/check-generics.test

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3628,7 +3628,8 @@ from typing import Generic, Callable
36283628
from typing_extensions import ParamSpec
36293629

36303630
P = ParamSpec("P")
3631-
class X1(Generic[P]): ...
3631+
class X1(Generic[P]):
3632+
def __call__(self, *a: P.args, **k: P.kwargs) -> None: ...
36323633
X2 = Callable[P, None]
36333634

36343635
x1: X1[()]
@@ -3637,8 +3638,10 @@ x2: X2[()]
36373638
reveal_type(x1) # N: Revealed type is "__main__.X1[[]]"
36383639
reveal_type(x2) # N: Revealed type is "def ()"
36393640

3641+
x1()
3642+
x1(5) # E: Too many arguments for "__call__" of "X1"
36403643
x2()
3641-
x2(int) # E: Too many arguments
3644+
x2(5) # E: Too many arguments
36423645
[builtins fixtures/tuple.pyi]
36433646

36443647
[case testMissingTypeArgsInApplication]

0 commit comments

Comments
 (0)