mirror of
https://gitlab.kit.edu/uskyk/typicalc.git
synced 2024-11-09 10:50:42 +00:00
Fixes exception thrown by last example
Not the most beautiful fix, but it works...
This commit is contained in:
parent
db48c7ffa0
commit
bbb0f7de38
@ -85,6 +85,8 @@ public class ExplanationCreatorUnification {
|
|||||||
if (isLetUnification) {
|
if (isLetUnification) {
|
||||||
createLetUnficiationFinish();
|
createLetUnficiationFinish();
|
||||||
}
|
}
|
||||||
|
} else if (isLetUnification) {
|
||||||
|
unificationTexts.remove(unificationTexts.size() - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -165,8 +167,13 @@ public class ExplanationCreatorUnification {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void createUnficationTexts() {
|
private void createUnficationTexts() {
|
||||||
List<UnificationStep> unificationSteps = typeInferer.getUnificationSteps()
|
List<UnificationStep> unificationSteps;
|
||||||
.orElseThrow(IllegalStateException::new);
|
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)
|
// skip first step since the substitutions list is still empty (unification introduction is shown)
|
||||||
for (int stepNum = 1; stepNum < unificationSteps.size(); stepNum++) {
|
for (int stepNum = 1; stepNum < unificationSteps.size(); stepNum++) {
|
||||||
@ -231,8 +238,10 @@ public class ExplanationCreatorUnification {
|
|||||||
private void createErrorText(UnificationError errorType) {
|
private void createErrorText(UnificationError errorType) {
|
||||||
if (errorType == UnificationError.INFINITE_TYPE) {
|
if (errorType == UnificationError.INFINITE_TYPE) {
|
||||||
unificationTexts.add(getDefaultTextLatex(KEY_PREFIX + "infiniteType"));
|
unificationTexts.add(getDefaultTextLatex(KEY_PREFIX + "infiniteType"));
|
||||||
|
unificationTexts.add(getDefaultTextLatex(KEY_PREFIX + "infiniteType"));
|
||||||
} else if (errorType == UnificationError.DIFFERENT_TYPES) {
|
} else if (errorType == UnificationError.DIFFERENT_TYPES) {
|
||||||
unificationTexts.add(getDefaultTextLatex(KEY_PREFIX + "differentTypes"));
|
unificationTexts.add(getDefaultTextLatex(KEY_PREFIX + "differentTypes"));
|
||||||
|
unificationTexts.add(getDefaultTextLatex(KEY_PREFIX + "differentTypes"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user