Browse Source

Add programs to trigger error cases.

search
Danila Fedorin 1 year ago
parent
commit
ca395b5c09
  1. 6
      code/compiler/13/examples/errors/double_catchall.txt
  2. 1
      code/compiler/13/examples/errors/duplicate_type_param.txt
  3. 7
      code/compiler/13/examples/errors/exhausted_patterns.txt
  4. 5
      code/compiler/13/examples/errors/incomplete_patterns.txt
  5. 7
      code/compiler/13/examples/errors/invalid_case_analysis.txt
  6. 7
      code/compiler/13/examples/errors/match_after_catchall.txt
  7. 8
      code/compiler/13/examples/errors/pattern_too_few_args.txt
  8. 8
      code/compiler/13/examples/errors/pattern_too_many_args.txt
  9. 6
      code/compiler/13/examples/errors/pattern_unknown_constructor.txt
  10. 1
      code/compiler/13/examples/errors/type_redefinition.txt
  11. 3
      code/compiler/13/examples/errors/unknown_lid.txt
  12. 1
      code/compiler/13/examples/errors/unknown_type.txt
  13. 1
      code/compiler/13/examples/errors/unknown_type_param.txt
  14. 3
      code/compiler/13/examples/errors/unknown_uid.txt
  15. 1
      code/compiler/13/examples/errors/wrong_type_kind.txt

6
code/compiler/13/examples/errors/double_catchall.txt

@ -0,0 +1,6 @@
defn main = {
case True of {
n -> { 2 }
n -> { 1 }
}
}

1
code/compiler/13/examples/errors/duplicate_type_param.txt

@ -0,0 +1 @@
data Pair a a = { MkPair a a }

7
code/compiler/13/examples/errors/exhausted_patterns.txt

@ -0,0 +1,7 @@
defn main = {
case True of {
True -> { 1 }
False -> { 0 }
n -> { 2 }
}
}

5
code/compiler/13/examples/errors/incomplete_patterns.txt

@ -0,0 +1,5 @@
defn main = {
case True of {
True -> { 1 }
}
}

7
code/compiler/13/examples/errors/invalid_case_analysis.txt

@ -0,0 +1,7 @@
defn add x y = { x + y }
defn main = {
case add of {
n -> { 1 }
}
}

7
code/compiler/13/examples/errors/match_after_catchall.txt

@ -0,0 +1,7 @@
defn main = {
case True of {
n -> { 2 }
True -> { 1 }
False -> { 0 }
}
}

8
code/compiler/13/examples/errors/pattern_too_few_args.txt

@ -0,0 +1,8 @@
data List = { Nil, Cons Int List }
defn head l = {
case l of {
Nil -> { 0 }
Cons x -> { x }
}
}

8
code/compiler/13/examples/errors/pattern_too_many_args.txt

@ -0,0 +1,8 @@
data List = { Nil, Cons Int List }
defn head l = {
case l of {
Nil -> { 0 }
Cons x y z -> { x }
}
}

6
code/compiler/13/examples/errors/pattern_unknown_constructor.txt

@ -0,0 +1,6 @@
defn main = {
case True of {
NotBool -> { 1 }
True -> { 2 }
}
}

1
code/compiler/13/examples/errors/type_redefinition.txt

@ -0,0 +1 @@
data Bool = { True, False }

3
code/compiler/13/examples/errors/unknown_lid.txt

@ -0,0 +1,3 @@
defn main = {
weird 1
}

1
code/compiler/13/examples/errors/unknown_type.txt

@ -0,0 +1 @@
data Wrapper = { Wrap Weird }

1
code/compiler/13/examples/errors/unknown_type_param.txt

@ -0,0 +1 @@
data Wrapper = { Wrap a }

3
code/compiler/13/examples/errors/unknown_uid.txt

@ -0,0 +1,3 @@
defn main = {
Weird 1
}

1
code/compiler/13/examples/errors/wrong_type_kind.txt

@ -0,0 +1 @@
data Wrapper = { Wrap (Int Bool) }
Loading…
Cancel
Save