From b19177cd6ddd959b4b7c104f38d3abb1d3c3f642 Mon Sep 17 00:00:00 2001 From: David Peter Date: Fri, 23 May 2025 15:08:14 +0200 Subject: [PATCH] Experiment: allow functions to be redefined (same signature) --- crates/ty_python_semantic/src/types.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/crates/ty_python_semantic/src/types.rs b/crates/ty_python_semantic/src/types.rs index c21144b719..7b6ba810c0 100644 --- a/crates/ty_python_semantic/src/types.rs +++ b/crates/ty_python_semantic/src/types.rs @@ -7203,10 +7203,9 @@ impl<'db> FunctionType<'db> { // However, our representation of a function literal includes any specialization that // should be applied to the signature. Different specializations of the same function // literal are only assignable to each other if they result in assignable signatures. - self.body_scope(db) == other.body_scope(db) - && self - .into_callable_type(db) - .is_assignable_to(db, other.into_callable_type(db)) + + self.into_callable_type(db) + .is_assignable_to(db, other.into_callable_type(db)) } fn is_equivalent_to(self, db: &'db dyn Db, other: Self) -> bool {