Skip to content

Commit

Permalink
Update crates/red_knot_python_semantic/src/types/infer.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Carl Meyer <carl@oddbird.net>
  • Loading branch information
Glyphack and carljm authored Dec 20, 2024
1 parent 092ba09 commit 3b1bca6
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions crates/red_knot_python_semantic/src/types/infer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1927,21 +1927,17 @@ impl<'db> TypeInferenceBuilder<'db> {

if let Some(value) = value.as_deref() {
let value_ty = self.infer_expression(value);
if self.file().is_stub(self.db().upcast()) {
self.add_declaration_with_binding(
assignment.into(),
definition,
annotation_ty,
Type::Unknown,
);
let value_ty = if self.file().is_stub(self.db().upcast()) && value.is_ellipsis_literal_expr() {
annotation_ty
} else {
self.add_declaration_with_binding(
assignment.into(),
definition,
annotation_ty,
value_ty,
);
value_ty
}
self.add_declaration_with_binding(
assignment.into(),
definition,
annotation_ty,
value_ty,
);
} else {
self.add_declaration(assignment.into(), definition, annotation_ty);
}
Expand Down

0 comments on commit 3b1bca6

Please sign in to comment.