catala/tests/test_enum/bad/missing_case.catala_en
2023-04-27 12:09:22 +02:00

48 lines
1.3 KiB
Plaintext

## Article
```catala
declaration enumeration E:
-- Case1 content integer
-- Case2 content boolean
-- Case3
declaration scope A:
context e content E
context out content boolean
scope A:
definition out equals match e with pattern
-- Case1 of i : i = 0
-- Case2 of b : b
```
```catala-test-inline
$ catala Interpret -s A
[WARNING] In scope "A", the variable "out" is never used anywhere; maybe it's unnecessary?
┌─⯈ tests/test_enum/bad/missing_case.catala_en:11.11-11.14:
└──┐
11 │ context out content boolean
│ ‾‾‾
└─ Article
[WARNING] The constructor "Case3" of enumeration "E" is never used; maybe it's unnecessary?
┌─⯈ tests/test_enum/bad/missing_case.catala_en:7.6-7.11:
└─┐
7 │ -- Case3
│ ‾‾‾‾‾
└─ Article
[ERROR] The constructor Case3 of enum E is missing from this pattern matching
┌─⯈ tests/test_enum/bad/missing_case.catala_en:14.25-16.22:
└──┐
14 │ definition out equals match e with pattern
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
15 │ -- Case1 of i : i = 0
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
16 │ -- Case2 of b : b
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
└─ Article
#return code 255#
```