lean4-htt/tests/lean/terminationFailure.lean.expected.out
Joachim Breitner ea20911a85
feat: Better error location in structural recursion (#2819)
previously, only the WellFounded code was making use of the error
location in the RecApp-metadata. We can do the same for structural
recursion. This way,
```
def f (n : Nat) : Nat :=
  match n with
  | 0 => 0
  | n + 1 => f (n + 1)
```
will show the error with squiggly lines under `f (n + 1)`, and not at
`def f`.
2023-11-05 22:24:17 +01:00

23 lines
625 B
Text

terminationFailure.lean:7:2-7:3: error: fail to show termination for
f.g
f
with errors
structural recursion does not handle mutually recursive functions
failed to prove termination, use `termination_by` to specify a well-founded relation
f (x : Nat) : Nat
f.g (a✝ : Nat) : Nat
1
2
terminationFailure.lean:24:9-24:12: error: fail to show termination for
h
with errors
argument #1 was not used for structural recursion
failed to eliminate recursive application
h x
structural recursion cannot be used
failed to prove termination, use `termination_by` to specify a well-founded relation
h (x : Nat) : Foo
Foo.a