This PR refines the new wording of the "application type mismatch" error message to avoid ambiguity in references to the "final" argument in a subexpression that may be followed by additional arguments. It does so by replacing "final" with "last," rephrasing the message so that this adjective modifies the argument itself rather than the word "argument," and only displaying this wording when two arguments could be confused (determined by expression equality). These changes were motivated by a report that in cases where a function application `f a b c` fails to elaborate because `b` is incorrectly typed, the existing error message's reference to `b` being the "final" argument in the application `f a b` may create confusion because it is not the final argument in the full application expression.
38 lines
1 KiB
Text
38 lines
1 KiB
Text
doErrorMsg.lean:3:2-3:13: error: type mismatch
|
|
IO.getStdin
|
|
has type
|
|
BaseIO IO.FS.Stream : Type
|
|
but is expected to have type
|
|
IO PUnit : Type
|
|
doErrorMsg.lean:15:19-15:21: error: type mismatch
|
|
f1
|
|
has type
|
|
ExceptT String (StateT Nat Id) Nat : Type
|
|
but is expected to have type
|
|
ExceptT String (StateT Nat Id) String : Type
|
|
doErrorMsg.lean:19:19-19:24: error: type mismatch
|
|
f2 10
|
|
has type
|
|
ExceptT String (StateT Nat Id) Nat : Type
|
|
but is expected to have type
|
|
ExceptT String (StateT Nat Id) String : Type
|
|
doErrorMsg.lean:23:10-23:12: error: type mismatch
|
|
f2
|
|
has type
|
|
Nat → ExceptT String (StateT Nat Id) Nat : Type
|
|
but is expected to have type
|
|
ExceptT String (StateT Nat Id) ?m : Type
|
|
doErrorMsg.lean:24:2-24:4: error: type mismatch
|
|
f1
|
|
has type
|
|
ExceptT String (StateT Nat Id) Nat : Type
|
|
but is expected to have type
|
|
ExceptT String (StateT Nat Id) String : Type
|
|
doErrorMsg.lean:28:13-28:18: error: Application type mismatch: In the application
|
|
Prod.mk false
|
|
the argument
|
|
false
|
|
has type
|
|
Bool : Type
|
|
but is expected to have type
|
|
Nat : Type
|