This PR improves the “expected type mismatch” error message by omitting the type's types when they are defeq, and putting them into separate lines when not. I found it rather tediuos to parse the error message when the expected type is long, because I had to find the `:` in the middle of a large expression somewhere. Also, when both are of sort `Prop` or `Type` it doesn't add much value to print the sort (and it’s only one hover away anyways).
21 lines
762 B
Text
21 lines
762 B
Text
calcErrors.lean:7:30-7:33: error: type mismatch
|
||
rfl
|
||
has type
|
||
?m = ?m
|
||
but is expected to have type
|
||
b + b = 0 + c + b
|
||
calcErrors.lean:13:8-13:29: error: invalid 'calc' step, left-hand side is
|
||
0 + c + b : Nat
|
||
but previous right-hand side is
|
||
b + b : Nat
|
||
calcErrors.lean:24:8-24:11: error: invalid 'calc' step, relation expected
|
||
p a
|
||
calcErrors.lean:31:8-31:13: error: invalid 'calc' step, failed to synthesize `Trans` instance
|
||
Trans p p ?m
|
||
|
||
Hint: Additional diagnostic information may be available using the `set_option diagnostics true` command.
|
||
calcErrors.lean:40:7-40:12: error: invalid 'calc' step, left-hand side is
|
||
γ : Sort u_1
|
||
but previous right-hand side is
|
||
b : β
|
||
calcErrors.lean:60:18-60:19: error: unexpected token '['; expected command
|