Skip to content

Commit 5f5c148

Browse files
committed
Substitute New Instance Name In Found State
This way the instances in the found and expected states match.
1 parent 758e963 commit 5f5c148

File tree

1 file changed

+2
-1
lines changed
  • liquidjava-verifier/src/main/java/liquidjava/processor/refinement_checker/object_checkers

1 file changed

+2
-1
lines changed

liquidjava-verifier/src/main/java/liquidjava/processor/refinement_checker/object_checkers/AuxStateHandler.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,8 @@ private static void changeState(TypeChecker tc, VariableInstance vi, List<Object
507507
// combine messages of all state changes
508508
String message = stateChanges.stream().map(ObjectState::getMessage)
509509
.filter(msg -> msg != null && !msg.isBlank()).distinct().collect(Collectors.joining("\n"));
510-
tc.throwStateRefinementError(invocation.getPosition(), prevState, expectedStatesDisjunction, message);
510+
Predicate foundState = prevState.substituteVariable(instanceName, newInstanceName);
511+
tc.throwStateRefinementError(invocation.getPosition(), foundState, expectedStatesDisjunction, message);
511512
}
512513
}
513514

0 commit comments

Comments
 (0)