catala/tests/enum/good/quick_pattern_check.catala_en
2024-05-03 15:27:06 +02:00

39 lines
641 B
Plaintext

## Article
```catala
declaration enumeration E:
-- Case1 content integer
-- Case2
declaration scope A:
context output x content E
context output y content boolean
context output z content boolean
scope A:
definition x equals Case1 content 2
definition y equals x with pattern Case1
definition z equals x with pattern Case2
```
```catala-test-inline
$ catala Typecheck --check-invariants
┌─[RESULT]─
│ All invariant checks passed
└─
┌─[RESULT]─
│ Typechecking successful!
└─
```
```catala-test-inline
$ catala test-scope A
┌─[RESULT]─
│ x = Case1 2
│ y = true
│ z = false
└─
```