@@ -3488,3 +3488,23 @@ reveal_type(join(f1, f2)) # N: Revealed type is "def ()"
34883488reveal_type(join(f1, f3)) # N: Revealed type is "def ()"
34893489reveal_type(join(f2, f3)) # N: Revealed type is "builtins.function" # TODO: this could be better
34903490[builtins fixtures/tuple.pyi]
3491+
3492+ [case testCallableJoinWithDefaultsMultiple]
3493+ from typing import TypeVar
3494+ T = TypeVar("T")
3495+ def join(t1: T, t2: T, t3: T) -> T: ...
3496+
3497+ def f_1(common, a=None): ...
3498+ def f_any(*_, **__): ...
3499+ def f_3(common, b=None, x=None): ...
3500+
3501+ fdict = {
3502+ "f_1": f_1, # E: Dict entry 0 has incompatible type "str": "Callable[[Any, Any], Any]"; expected "str": "Callable[[Any, Any, Any], Any]"
3503+ "f_any": f_any,
3504+ "f_3": f_3,
3505+ }
3506+ reveal_type(fdict) # N: Revealed type is "builtins.dict[builtins.str, def (common: Any, b: Any =, x: Any =) -> Any]"
3507+
3508+ reveal_type(join(f_1, f_any, f_3)) # N: Revealed type is "def (common: Any, b: Any =, x: Any =) -> Any" \
3509+ # E: Argument 1 to "join" has incompatible type "Callable[[Any, Any], Any]"; expected "Callable[[Any, Any, Any], Any]"
3510+ [builtins fixtures/tuple.pyi]
0 commit comments