lean4-htt/tests/elab_fail/funind_reserved.lean
Garmelon 08eb78a5b2
chore: switch to new test/bench suite (#12590)
This PR sets up the new integrated test/bench suite. It then migrates
all benchmarks and some related tests to the new suite. There's also
some documentation and some linting.

For now, a lot of the old tests are left alone so this PR doesn't become
even larger than it already is. Eventually, all tests should be migrated
to the new suite though so there isn't a confusing mix of two systems.
2026-02-25 13:51:53 +00:00

96 lines
1.3 KiB
Text

-- Test that the reserved name availability is checked at function definition time
namespace Nonrec
def foo.induct := 1
def foo : (n : Nat) → Nat -- no error (yet)
| 0 => 0
| n+1 => n
end Nonrec
namespace Structural
def foo.induct := 1
def foo : (n : Nat) → Nat -- error
| 0 => 0
| n+1 => foo n
end Structural
namespace WF
def foo.induct := 1
def foo : (n : Nat) → Nat -- error
| 0 => 0
| n+1 => foo n
termination_by n => n
end WF
namespace Mutual1
def foo.induct := 1
mutual
def foo : (n : Nat) → Nat -- error
| 0 => 0
| n+1 => bar n
termination_by n => n
def bar : (n : Nat) → Nat -- error
| 0 => 0
| n+1 => foo n
termination_by n => n
end
end Mutual1
namespace Mutual2
def bar.induct := 1
mutual
def foo : (n : Nat) → Nat -- error
| 0 => 0
| n+1 => bar n
termination_by n => n
def bar : (n : Nat) → Nat
| 0 => 0
| n+1 => foo n
termination_by n => n
end
end Mutual2
namespace Mutual3
def foo.mutual_induct := 1
mutual
def foo : (n : Nat) → Nat -- error
| 0 => 0
| n+1 => bar n
termination_by n => n
def bar : (n : Nat) → Nat
| 0 => 0
| n+1 => foo n
termination_by n => n
end
end Mutual3
namespace Nested
def foo : (n : Nat) → Nat -- error
| 0 => 0
| n+1 => foo n
where induct := 1
end Nested