mirror of
https://github.com/CatalaLang/catala.git
synced 2024-11-09 01:35:56 +03:00
48 lines
1.3 KiB
Plaintext
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#
|
|
```
|