lean4-htt/tests/lean/invalidNamedArgs.lean
jrr6 fb462fdf9e
feat: add named argument hints (#9315)
This PR adds improves the "invalid named argument" error message in
function applications and match patterns by providing clickable hints
with valid argument names. In so doing, it also fixes an issue where
this error message would erroneously flag valid match-pattern argument
names.
2025-07-17 03:22:25 +00:00

22 lines
436 B
Text

def ex1 (xs : List Nat) : Nat :=
xs.foldl (b := 0) fun sum x => sum + x
def f (a : Nat) (flag := true) : Nat :=
a + if flag then 1 else 0
def g (a : Nat) : Nat :=
f a (flg := false)
def T : Nat → Type
| 0 => (x : Nat) → Bool
| _ + 1 => (y : Nat) → Bool
def h : (n : Nat) → T n
| 0 => fun x => x == 0
| n + 1 => fun y => y == n
example := h (n := 0) (k := 7)
example := h (n := 31) (k := 7)
example := h (k := 7)