lean4-htt/tests/elab_fail/inductive1.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

118 lines
1.9 KiB
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.

--
-- Test1
inductive T1 : Nat -- Error, resultant type is not a sort
-- Test2
mutual
inductive T1 : Prop
inductive T2 : Type -- Error resulting universe mismatch
end
-- Test3
universe u v
mutual
inductive T1 (x : Nat) : Type u
inductive T2 (x : Nat) : Nat → Type v -- Error resulting universe mismatch
end
-- Test4
mutual
inductive T1 (b : Bool) (x : Nat) : Type
inductive T2 (b : Bool) (x : Bool) : Type -- Type mismatch at 'x'
end
-- Test5
mutual
inductive T1 (b : Bool) (x : Nat) : Type
inductive T2 (x : Bool) : Type -- number of parameters mismatch
end
-- Test6
mutual
inductive T1 (b : Bool) (x : Nat) : Type
inductive T2 (b : Bool) {x : Nat} : Type -- binder annotation mismatch at 'x'
end
-- Test7
mutual
inductive T1.{w1} (b : Bool) (x : Nat) : Type
inductive T2.{w2} (b : Bool) (x : Nat) : Type -- universe parameter mismatch
end
-- Test8
namespace Boo
def T1.bla := 10
inductive T1 : Type
| bla : T1 -- Boo.T1.bla has already been defined
def T1 := 20
inductive T1 : Type -- Boo.T1 has already been defined
| bla : T1
end Boo
-- Test9
partial inductive T1 : Type -- invalid use of partial
noncomputable inductive T1 : Type -- invalid use of noncomputable
@[inline] inductive T1' : Type -- declaration is not a definition
private inductive T1 : Type
| private mk : T1 -- invalid private constructor in private inductive type
-- Test10
mutual
inductive T1 : Type
unsafe inductive T2 : Type
end
-- Test11
inductive T1 : Nat → Type
| z1 : T1 0
| z2 -- constructor resulting type must be specified in inductive family declaration
-- Test12
inductive T1 : Nat → Type
| z1 : T1 -- unexpected constructor resulting type
inductive T1 : Nat → Type
| z1 : Nat -- unexpected constructor resulting type
-- Test13
inductive A (α : Type u) (β : Type v)
| nil
| protected cons : α → β → A α β → A α β
open A
#check cons -- unknown `cons`, it is protected