lean4-htt/tests/lean/run/5475.lean
Kyle Miller d10d41bc07
fix: store local context for 'don't know how to synthesize implicit argument' errors (#5658)
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
2024-10-09 08:40:21 +00:00

23 lines
465 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/-!
# 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)