Skip to content

Commit

Permalink
fix regression be more complete propagation of outerExpressionType
Browse files Browse the repository at this point in the history
  • Loading branch information
stephan-herrmann committed Oct 23, 2024
1 parent 7d2f381 commit c6e81db
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ public void setIsGuarded() {
this.patterns[i].setIsGuarded();
}

@Override
public void setOuterExpressionType(TypeBinding expressionType) {
super.setOuterExpressionType(expressionType);
for (int i = 0; i < this.patternsCount; i++)
this.patterns[i].setOuterExpressionType(expressionType);
}

@Override
public TypeBinding resolveType(BlockScope scope) {
boolean hasError = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ public void setIsEitherOrPattern() {
this.primaryPattern.setIsEitherOrPattern();
}

@Override
public void setOuterExpressionType(TypeBinding expressionType) {
super.setOuterExpressionType(expressionType);
this.primaryPattern.setOuterExpressionType(expressionType);
}

@Override
public boolean coversType(TypeBinding type, Scope scope) {
return isUnguarded() && this.primaryPattern.coversType(type, scope);
Expand Down

0 comments on commit c6e81db

Please sign in to comment.