Skip to content

Commit

Permalink
Fix ISE
Browse files Browse the repository at this point in the history
Fixes #345
  • Loading branch information
valis committed Jul 30, 2024
1 parent d3d03dc commit 1f40beb
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ public Expression visitFieldCall(FieldCallExpression expr, Void params) {
if (myNormalizing) {
type = type.normalize(NormalizationMode.WHNF);
}
if (type instanceof ClassCallExpression classCall) {
if (type instanceof ClassCallExpression classCall && classCall.getDefinition().isSubClassOf(expr.getDefinition().getParentClass())) {
if (classCall.getDefinition().getOverriddenType(expr.getDefinition()) != null) {
return classCall.getDefinition().getOverriddenType(expr.getDefinition(), myMinimal ? minimizeLevels(classCall) : classCall.getLevels()).applyExpression(expr.getArgument());
}
Expand Down Expand Up @@ -430,7 +430,7 @@ public Expression visitTypeDestructor(TypeDestructorExpression expr, Void params
} else {
type = type.getUnderlyingExpression();
}
if (!(type instanceof FunCallExpression funCall && ((FunCallExpression) type).getDefinition() == expr.getDefinition())) {
if (!(type instanceof FunCallExpression funCall && funCall.getDefinition() == expr.getDefinition())) {
return type instanceof ErrorExpression ? type : new ErrorExpression();
}

Expand Down

0 comments on commit 1f40beb

Please sign in to comment.