@@ -2473,7 +2473,8 @@ def func(caller: Caller) -> None:
2473
2473
pass
2474
2474
2475
2475
func(call)
2476
- func(bad) # E: Argument 1 to "func" has incompatible type "Callable[[int, VarArg(str)], None]"; expected "Caller"
2476
+ func(bad) # E: Argument 1 to "func" has incompatible type "Callable[[int, VarArg(str)], None]"; expected "Caller" \
2477
+ # N: "Caller.__call__" has type "Callable[[Arg(str, 'x'), VarArg(int)], None]"
2477
2478
[builtins fixtures/tuple.pyi]
2478
2479
[out]
2479
2480
@@ -2510,7 +2511,8 @@ def func(caller: Caller) -> None:
2510
2511
pass
2511
2512
2512
2513
func(call)
2513
- func(bad) # E: Argument 1 to "func" has incompatible type "Callable[[int], int]"; expected "Caller"
2514
+ func(bad) # E: Argument 1 to "func" has incompatible type "Callable[[int], int]"; expected "Caller" \
2515
+ # N: "Caller.__call__" has type "Callable[[Arg(T, 'x')], T]"
2514
2516
[builtins fixtures/tuple.pyi]
2515
2517
[out]
2516
2518
@@ -2530,7 +2532,8 @@ def func(caller: Caller) -> None:
2530
2532
pass
2531
2533
2532
2534
func(call)
2533
- func(bad) # E: Argument 1 to "func" has incompatible type "Callable[[T], Tuple[T, T]]"; expected "Caller"
2535
+ func(bad) # E: Argument 1 to "func" has incompatible type "Callable[[T], Tuple[T, T]]"; expected "Caller" \
2536
+ # N: "Caller.__call__" has type "Callable[[Arg(int, 'x')], int]"
2534
2537
[builtins fixtures/tuple.pyi]
2535
2538
[out]
2536
2539
@@ -2557,7 +2560,8 @@ def func(caller: Caller) -> None:
2557
2560
pass
2558
2561
2559
2562
func(call)
2560
- func(bad) # E: Argument 1 to "func" has incompatible type "Callable[[Union[int, str]], Union[int, str]]"; expected "Caller"
2563
+ func(bad) # E: Argument 1 to "func" has incompatible type "Callable[[Union[int, str]], Union[int, str]]"; expected "Caller" \
2564
+ # N: "Caller.__call__" has type overloaded function
2561
2565
[out]
2562
2566
2563
2567
[case testCallableImplementsProtocolExtraNote]
@@ -2596,7 +2600,8 @@ def anon(caller: CallerAnon) -> None:
2596
2600
2597
2601
2598
2602
func(call)
2599
- func(bad) # E: Argument 1 to "func" has incompatible type "Callable[[str], None]"; expected "Caller"
2603
+ func(bad) # E: Argument 1 to "func" has incompatible type "Callable[[str], None]"; expected "Caller" \
2604
+ # N: "Caller.__call__" has type "Callable[[Arg(str, 'x')], None]"
2600
2605
anon(bad)
2601
2606
[out]
2602
2607
@@ -2619,7 +2624,8 @@ a: Other
2619
2624
b: Bad
2620
2625
2621
2626
func(a)
2622
- func(b) # E: Argument 1 to "func" has incompatible type "Bad"; expected "One"
2627
+ func(b) # E: Argument 1 to "func" has incompatible type "Bad"; expected "One" \
2628
+ # N: "One.__call__" has type "Callable[[Arg(str, 'x')], None]"
2623
2629
[out]
2624
2630
2625
2631
[case testJoinProtocolCallback]
@@ -3589,7 +3595,8 @@ test(C) # E: Argument 1 to "test" has incompatible type "Type[C]"; expected "P"
3589
3595
# N: Expected: \
3590
3596
# N: def __call__(x: int, y: int) -> Any \
3591
3597
# N: Got: \
3592
- # N: def __init__(x: int, y: str) -> C
3598
+ # N: def __init__(x: int, y: str) -> C \
3599
+ # N: "P.__call__" has type "Callable[[Arg(int, 'x'), Arg(int, 'y')], Any]"
3593
3600
3594
3601
[case testProtocolClassObjectPureCallback]
3595
3602
from typing import Any, ClassVar, Protocol
@@ -3610,7 +3617,8 @@ test(C) # E: Argument 1 to "test" has incompatible type "Type[C]"; expected "P"
3610
3617
# N: Expected: \
3611
3618
# N: def __call__(x: int, y: int) -> Any \
3612
3619
# N: Got: \
3613
- # N: def __init__(x: int, y: str) -> C
3620
+ # N: def __init__(x: int, y: str) -> C \
3621
+ # N: "P.__call__" has type "Callable[[Arg(int, 'x'), Arg(int, 'y')], Any]"
3614
3622
[builtins fixtures/type.pyi]
3615
3623
3616
3624
[case testProtocolClassObjectCallableError]
0 commit comments