Skip to content
Snippets Groups Projects
Commit dcec9077 authored by dgelessus's avatar dgelessus
Browse files

Fix source code not being shown in :type errors

parent 83361fe2
Branches
Tags
No related merge requests found
Pipeline #73950 passed
......@@ -68,12 +68,14 @@ public final class TypeCommand implements Command {
final ProBKernel kernel = this.kernelProvider.get();
final Trace trace = this.animationSelector.getCurrentTrace();
final IEvalElement formula = kernel.parseFormula(args.get(FORMULA_PARAM), FormulaExpand.EXPAND);
return CommandUtils.withSourceCode(formula, () -> {
final TypeCheckResult result = trace.getStateSpace().typeCheck(formula);
if (result.isOk()) {
return new DisplayData(result.getType());
} else {
throw new ProBError("Type errors in formula", result.getErrors());
}
});
}
@Override
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment