diff --git a/crates/ty_python_semantic/resources/mdtest/call/overloads.md b/crates/ty_python_semantic/resources/mdtest/call/overloads.md index 8d1f2930cd..ca447b6063 100644 --- a/crates/ty_python_semantic/resources/mdtest/call/overloads.md +++ b/crates/ty_python_semantic/resources/mdtest/call/overloads.md @@ -876,8 +876,7 @@ def _(list_int: list[int], list_str: list[str], list_any: list[Any], any: Any): # TODO: revealed: A reveal_type(f(*(list_int,))) # revealed: Unknown - # TODO: Should be `str` - reveal_type(f(list_str)) # revealed: Unknown + reveal_type(f(list_str)) # revealed: str # TODO: Should be `str` reveal_type(f(*(list_str,))) # revealed: Unknown diff --git a/crates/ty_python_semantic/src/types/call/bind.rs b/crates/ty_python_semantic/src/types/call/bind.rs index e064212225..226454e748 100644 --- a/crates/ty_python_semantic/src/types/call/bind.rs +++ b/crates/ty_python_semantic/src/types/call/bind.rs @@ -1497,9 +1497,17 @@ impl<'db> CallableBinding<'db> { } // TODO: For an unannotated `self` / `cls` parameter, the type should be // `typing.Self` / `type[typing.Self]` - let parameter_type = overload.signature.parameters()[*parameter_index] + let mut parameter_type = overload.signature.parameters()[*parameter_index] .annotated_type() .unwrap_or(Type::unknown()); + if let Some(specialization) = overload.specialization { + parameter_type = + parameter_type.apply_specialization(db, specialization); + } + if let Some(inherited_specialization) = overload.inherited_specialization { + parameter_type = + parameter_type.apply_specialization(db, inherited_specialization); + } current_parameter_types.push(parameter_type); } }