Commit bbb0f7de authored by Robin's avatar Robin
Browse files

Fixes exception thrown by last example

Not the most beautiful fix, but it works...
parent db48c7ff
Pipeline #167086 passed with stages
in 2 minutes and 22 seconds
......@@ -85,6 +85,8 @@ public class ExplanationCreatorUnification {
if (isLetUnification) {
createLetUnficiationFinish();
}
} else if (isLetUnification) {
unificationTexts.remove(unificationTexts.size() - 1);
}
}
......@@ -165,8 +167,13 @@ public class ExplanationCreatorUnification {
}
private void createUnficationTexts() {
List<UnificationStep> unificationSteps = typeInferer.getUnificationSteps()
.orElseThrow(IllegalStateException::new);
List<UnificationStep> unificationSteps;
if (typeInferer.getUnificationSteps().isPresent()) {
unificationSteps = typeInferer.getUnificationSteps().get();
} else {
errorOccurred = true;
return;
}
// skip first step since the substitutions list is still empty (unification introduction is shown)
for (int stepNum = 1; stepNum < unificationSteps.size(); stepNum++) {
......@@ -231,8 +238,10 @@ public class ExplanationCreatorUnification {
private void createErrorText(UnificationError errorType) {
if (errorType == UnificationError.INFINITE_TYPE) {
unificationTexts.add(getDefaultTextLatex(KEY_PREFIX + "infiniteType"));
unificationTexts.add(getDefaultTextLatex(KEY_PREFIX + "infiniteType"));
} else if (errorType == UnificationError.DIFFERENT_TYPES) {
unificationTexts.add(getDefaultTextLatex(KEY_PREFIX + "differentTypes"));
unificationTexts.add(getDefaultTextLatex(KEY_PREFIX + "differentTypes"));
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment