Add programs to trigger error cases.
This commit is contained in:
parent
2ede230704
commit
0e816e523a
6
13/examples/errors/double_catchall.txt
Normal file
6
13/examples/errors/double_catchall.txt
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
defn main = {
|
||||||
|
case True of {
|
||||||
|
n -> { 2 }
|
||||||
|
n -> { 1 }
|
||||||
|
}
|
||||||
|
}
|
1
13/examples/errors/duplicate_type_param.txt
Normal file
1
13/examples/errors/duplicate_type_param.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
data Pair a a = { MkPair a a }
|
7
13/examples/errors/exhausted_patterns.txt
Normal file
7
13/examples/errors/exhausted_patterns.txt
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
defn main = {
|
||||||
|
case True of {
|
||||||
|
True -> { 1 }
|
||||||
|
False -> { 0 }
|
||||||
|
n -> { 2 }
|
||||||
|
}
|
||||||
|
}
|
5
13/examples/errors/incomplete_patterns.txt
Normal file
5
13/examples/errors/incomplete_patterns.txt
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
defn main = {
|
||||||
|
case True of {
|
||||||
|
True -> { 1 }
|
||||||
|
}
|
||||||
|
}
|
7
13/examples/errors/invalid_case_analysis.txt
Normal file
7
13/examples/errors/invalid_case_analysis.txt
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
defn add x y = { x + y }
|
||||||
|
|
||||||
|
defn main = {
|
||||||
|
case add of {
|
||||||
|
n -> { 1 }
|
||||||
|
}
|
||||||
|
}
|
7
13/examples/errors/match_after_catchall.txt
Normal file
7
13/examples/errors/match_after_catchall.txt
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
defn main = {
|
||||||
|
case True of {
|
||||||
|
n -> { 2 }
|
||||||
|
True -> { 1 }
|
||||||
|
False -> { 0 }
|
||||||
|
}
|
||||||
|
}
|
8
13/examples/errors/pattern_too_few_args.txt
Normal file
8
13/examples/errors/pattern_too_few_args.txt
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
data List = { Nil, Cons Int List }
|
||||||
|
|
||||||
|
defn head l = {
|
||||||
|
case l of {
|
||||||
|
Nil -> { 0 }
|
||||||
|
Cons x -> { x }
|
||||||
|
}
|
||||||
|
}
|
8
13/examples/errors/pattern_too_many_args.txt
Normal file
8
13/examples/errors/pattern_too_many_args.txt
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
data List = { Nil, Cons Int List }
|
||||||
|
|
||||||
|
defn head l = {
|
||||||
|
case l of {
|
||||||
|
Nil -> { 0 }
|
||||||
|
Cons x y z -> { x }
|
||||||
|
}
|
||||||
|
}
|
6
13/examples/errors/pattern_unknown_constructor.txt
Normal file
6
13/examples/errors/pattern_unknown_constructor.txt
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
defn main = {
|
||||||
|
case True of {
|
||||||
|
NotBool -> { 1 }
|
||||||
|
True -> { 2 }
|
||||||
|
}
|
||||||
|
}
|
1
13/examples/errors/type_redefinition.txt
Normal file
1
13/examples/errors/type_redefinition.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
data Bool = { True, False }
|
3
13/examples/errors/unknown_lid.txt
Normal file
3
13/examples/errors/unknown_lid.txt
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
defn main = {
|
||||||
|
weird 1
|
||||||
|
}
|
1
13/examples/errors/unknown_type.txt
Normal file
1
13/examples/errors/unknown_type.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
data Wrapper = { Wrap Weird }
|
1
13/examples/errors/unknown_type_param.txt
Normal file
1
13/examples/errors/unknown_type_param.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
data Wrapper = { Wrap a }
|
3
13/examples/errors/unknown_uid.txt
Normal file
3
13/examples/errors/unknown_uid.txt
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
defn main = {
|
||||||
|
Weird 1
|
||||||
|
}
|
1
13/examples/errors/wrong_type_kind.txt
Normal file
1
13/examples/errors/wrong_type_kind.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
data Wrapper = { Wrap (Int Bool) }
|
Loading…
Reference in New Issue
Block a user