test: add structure field default value test
This commit is contained in:
parent
f53721e1c9
commit
74686a149a
2 changed files with 17 additions and 0 deletions
11
tests/lean/structDefault.lean
Normal file
11
tests/lean/structDefault.lean
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
structure A where
|
||||
f : Nat → Nat → Nat
|
||||
|
||||
structure B extends A where
|
||||
f (a b : Nat) := 10
|
||||
|
||||
structure C extends A where
|
||||
f a b := 0
|
||||
|
||||
structure D extends A where
|
||||
f a b := true -- error
|
||||
6
tests/lean/structDefault.lean.expected.out
Normal file
6
tests/lean/structDefault.lean.expected.out
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
structDefault.lean:11:11: error: type mismatch
|
||||
true
|
||||
has type
|
||||
Bool
|
||||
but is expected to have type
|
||||
Nat
|
||||
Loading…
Add table
Reference in a new issue