Skip to content

Commit

Permalink
fix: Regression in type inference in type-only analysis due to prior …
Browse files Browse the repository at this point in the history
…var-cache changes
  • Loading branch information
Col-E committed Sep 1, 2024
1 parent 0ce54b6 commit 174daf2
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ public boolean merge(@NotNull InheritanceChecker checker, @NotNull TypedFrame ot
// Our frame doesn't have the local variable.
// Copy it if we know the type.
setLocal(index, otherLocal);

// If we are learning the type of the variable where it was previously 'null'
// then we will mark the frame as being changed. But if the other frame also has 'null'
// as the type then we don't want to be marked as changed (will cause an infinite loop).
changed = otherType != null;
} else if (otherLocal.isNull()) {
// Our frame can be updated to fill in 'null' with a known type.
setLocal(index, otherLocal.adaptType(ourType));
Expand Down

0 comments on commit 174daf2

Please sign in to comment.