From 4d835dabad154a79867945e684a5f4fdc4e0acec Mon Sep 17 00:00:00 2001 From: Shaygan Hooshyari Date: Mon, 16 Dec 2024 13:24:49 -0800 Subject: [PATCH] Update crates/red_knot_python_semantic/src/types/infer.rs Co-authored-by: Carl Meyer --- crates/red_knot_python_semantic/src/types/infer.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/red_knot_python_semantic/src/types/infer.rs b/crates/red_knot_python_semantic/src/types/infer.rs index 79480ae326b79b..3528aac23d74a6 100644 --- a/crates/red_knot_python_semantic/src/types/infer.rs +++ b/crates/red_knot_python_semantic/src/types/infer.rs @@ -1127,7 +1127,7 @@ impl<'db> TypeInferenceBuilder<'db> { let inferred_ty = if let Some(default_ty) = default_ty { if default_ty.is_assignable_to(self.db, declared_ty) { UnionType::from_elements(self.db, [declared_ty, default_ty]) - } else if default + } else if self.file.is_stub() && default .as_ref() .is_some_and(|d| d.is_ellipsis_literal_expr()) {