When named arguments introduce eta arguments, the full application contains fvars for these eta arguments, so `MVarErrorKind.implicitArg` needs to keep a local context for its error messages. This is because the local context of the mvar associated to the `MVarErrorKind` is not sufficient, since when an eta argument come after an implicit argument, the implicit argument's mvar doesn't contain the eta argument's fvar in its local context. Closes #5475
23 lines
465 B
Text
23 lines
465 B
Text
/-!
|
||
# Eta arguments had wrong context in "don't know how to synthesize implicit" errors
|
||
https://github.com/leanprover/lean4/issues/5475
|
||
-/
|
||
|
||
set_option pp.mvars false
|
||
|
||
/-!
|
||
Formerly, argument `x` appeared as `_fvar.123`
|
||
-/
|
||
|
||
def f {α β : Type} (x: α) (y: β) : α := x
|
||
/--
|
||
error: don't know how to synthesize implicit argument 'α'
|
||
@f ?_ Nat x Nat.zero
|
||
context:
|
||
⊢ Type
|
||
---
|
||
error: failed to infer definition type
|
||
-/
|
||
#guard_msgs in
|
||
example :=
|
||
f (y := Nat.zero)
|