Skip to content

Commit

Permalink
WIP: extracted TypeInferenceContext
Browse files Browse the repository at this point in the history
  • Loading branch information
carljm committed Sep 17, 2024
1 parent 23c2cc7 commit a44c681
Show file tree
Hide file tree
Showing 2 changed files with 348 additions and 294 deletions.
7 changes: 3 additions & 4 deletions crates/red_knot_python_semantic/src/types.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use infer::TypeInferenceBuilder;
use infer::TypeInferenceContext;
use ruff_db::files::File;
use ruff_python_ast as ast;

Expand Down Expand Up @@ -647,13 +647,12 @@ enum IterationOutcome<'db> {
impl<'db> IterationOutcome<'db> {
fn unwrap_with_diagnostic(
self,
iterable_node: ast::AnyNodeRef,
inference_builder: &mut TypeInferenceBuilder<'db>,
inference_context: &mut TypeInferenceContext<'db>,
) -> Type<'db> {
match self {
Self::Iterable { element_ty } => element_ty,
Self::NotIterable { not_iterable_ty } => {
inference_builder.not_iterable_diagnostic(iterable_node, not_iterable_ty);
inference_context.not_iterable_diagnostic(not_iterable_ty);
Type::Unknown
}
}
Expand Down
Loading

0 comments on commit a44c681

Please sign in to comment.