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.
19 lines
575 B
Text
19 lines
575 B
Text
namedHoles.lean:9:12-9:14: error: Application type mismatch: In the application
|
|
f ?x ?x
|
|
the last
|
|
?x
|
|
argument has type
|
|
Nat : Type
|
|
but is expected to have type
|
|
Bool : Type
|
|
f ?x sorry : Nat
|
|
g ?x ?x : Nat
|
|
20
|
|
foo (fun x => ?hole) ?hole : Nat
|
|
bla ?hole fun x => ?hole : Nat
|
|
namedHoles.lean:35:38-35:43: error: synthetic hole has already been defined with an incompatible local context
|
|
boo (fun x => ?hole) fun y => sorry : Nat
|
|
11
|
|
12
|
|
namedHoles.lean:58:26-58:31: error: synthetic hole has already been defined and assigned to value incompatible with the current context
|
|
y
|