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).
36 lines
762 B
Text
36 lines
762 B
Text
423.lean:3:35-3:40: error: Application type mismatch: In the application
|
|
HAdd.hAdd a
|
|
the argument
|
|
a
|
|
has type
|
|
T
|
|
of sort `Sort u` but is expected to have type
|
|
Nat
|
|
of sort `Type`
|
|
423.lean:5:37-5:38: error: Application type mismatch: In the application
|
|
Add T
|
|
the argument
|
|
T
|
|
has type
|
|
Sort u
|
|
of sort `Type u` but is expected to have type
|
|
Type ?u
|
|
of sort `Type (?u + 1)`
|
|
423.lean:5:47-5:48: error: Application type mismatch: In the application
|
|
OfNat T
|
|
the argument
|
|
T
|
|
has type
|
|
Sort u
|
|
of sort `Type u` but is expected to have type
|
|
Type ?u
|
|
of sort `Type (?u + 1)`
|
|
423.lean:5:55-5:60: error: Application type mismatch: In the application
|
|
HAdd.hAdd a
|
|
the argument
|
|
a
|
|
has type
|
|
T
|
|
of sort `Sort u` but is expected to have type
|
|
Nat
|
|
of sort `Type`
|