This PR improves the message and range of infer binder type failures. --------- Co-authored-by: Joseph Rotella <7482866+jrr6@users.noreply.github.com>
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 type of example
|
||
-/
|
||
#guard_msgs in
|
||
example :=
|
||
f (y := Nat.zero)
|