Commit dcec9077 authored by dgelessus's avatar dgelessus
Browse files

Fix source code not being shown in :type errors

parent 83361fe2
Pipeline #73950 passed with stage
in 1 minute and 56 seconds
......@@ -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);
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());
}
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
......
Supports Markdown
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