Skip to content

Commit 04f57df

Browse files
committed
remove unnecessary code
1 parent c9f2625 commit 04f57df

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

crates/ty_python_semantic/src/semantic_index/builder.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,8 @@ impl<'db, 'ast> SemanticIndexBuilder<'db, 'ast> {
504504

505505
if popped_scope.is_eager() {
506506
self.record_eager_snapshots(popped_scope_id);
507-
} else {
507+
} else if !popped_scope.kind().is_type_alias() {
508+
// Don't record lazy snapshots in a type alias scope, as it is a deferred evaluation context.
508509
self.record_lazy_snapshots(popped_scope_id);
509510
}
510511

crates/ty_python_semantic/src/types/infer.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6779,12 +6779,6 @@ impl<'db, 'ast> TypeInferenceBuilder<'db, 'ast> {
67796779
bindings,
67806780
SnapshotCompleteness::Complete,
67816781
) => {
6782-
if place_expr.is_symbol()
6783-
&& !enclosing_scope_id.is_function_like(db)
6784-
&& !is_immediately_enclosing_scope
6785-
{
6786-
continue;
6787-
}
67886782
let place = place_from_bindings(db, bindings).map_type(|ty| {
67896783
self.narrow_place_with_applicable_constraints(
67906784
place_expr,
@@ -6802,12 +6796,6 @@ impl<'db, 'ast> TypeInferenceBuilder<'db, 'ast> {
68026796
_,
68036797
SnapshotCompleteness::Incomplete(_, snapshot),
68046798
) => {
6805-
if place_expr.is_symbol()
6806-
&& !enclosing_scope_id.is_function_like(db)
6807-
&& !is_immediately_enclosing_scope
6808-
{
6809-
continue;
6810-
}
68116799
considered_definitions =
68126800
ConsideredDefinitions::AllReachable(Some(snapshot));
68136801
}

0 commit comments

Comments
 (0)