lean4-htt/tests/lean/run/5475.lean
Leonardo de Moura eabde77d84
fix: improve type-as-hole error message (#8262)
This PR improves the type-as-hole error message. Type-as-hole error for
theorem declarations should not admit the possibility of omitting the
type entirely.

---------

Co-authored-by: Joachim Breitner <mail@joachim-breitner.de>
2025-05-09 22:49:37 +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 type of example
-/
#guard_msgs in
example :=
f (y := Nat.zero)