lean4-htt/tests/lean/letRecMissingAnnotation.lean
Leonardo de Moura 739ef7d166 fix: annotate let rec declarations as auxDecl
Reason:
1- Tactics such as `assumption` should ignore them.
2- We must annotate recursive applications with `mkRecAppWithSyntax`.
2022-01-10 14:35:05 -08:00

8 lines
235 B
Text

def sum (as : Array Nat) : Nat :=
let rec go (i : Nat) (s : Nat) : Nat :=
if h : i < as.size then
go (i+2) (s + as.get ⟨i, h⟩) -- Error
else
s
go 0 0
termination_by measure (fun ⟨a, i, _⟩ => a.size - i)