lean4-htt/tests/lean/run/5475.lean
Kyle Miller f771dea78b
fix: make sure app elaborator eta feature does not result in capturable variables (#10377)
This PR fixes an issue where the "eta feature" in the app elaborator,
which is invoked when positional arguments are skipped due to named
arguments, results in variables that can be captured by those named
arguments. Now the temporary local variables that implement this feature
get fresh names. The names used for the closed lambda expression still
use the original parameter names.

Closes #6373
2025-09-14 20:19:50 +00:00

23 lines
468 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)