From 1a15d237930c4a6056caf35617c1d2e851151158 Mon Sep 17 00:00:00 2001 From: Douglas Creager Date: Mon, 15 Dec 2025 19:55:53 -0500 Subject: [PATCH] only error when there are typevars --- crates/ty_python_semantic/src/types/generics.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/ty_python_semantic/src/types/generics.rs b/crates/ty_python_semantic/src/types/generics.rs index fe3014e47f..90ab8ed824 100644 --- a/crates/ty_python_semantic/src/types/generics.rs +++ b/crates/ty_python_semantic/src/types/generics.rs @@ -1886,7 +1886,9 @@ impl<'db> SpecializationBuilder<'db> { let when = actual .when_constraint_set_assignable_to(self.db, formal, self.inferable) .limit_to_valid_specializations(self.db); - if when.is_never_satisfied(self.db) { + if when.is_never_satisfied(self.db) + && (formal.has_typevar(self.db) || actual.has_typevar(self.db)) + { return Err(SpecializationError::NoSolution { parameter: formal, argument: actual,