2021-06-03 11:49:02 +03:00
|
|
|
## Wildcard cannot be used as single match case
|
|
|
|
|
|
|
|
```catala
|
|
|
|
declaration enumeration E:
|
|
|
|
-- Case1
|
|
|
|
-- Case2
|
|
|
|
|
|
|
|
declaration scope A:
|
|
|
|
context x content E
|
|
|
|
context y content integer
|
|
|
|
|
|
|
|
scope A:
|
|
|
|
definition x equals Case1
|
|
|
|
definition y equals match x with pattern
|
2021-06-03 16:47:07 +03:00
|
|
|
-- anything : 31
|
2021-06-03 11:49:02 +03:00
|
|
|
```
|
2022-07-08 17:23:09 +03:00
|
|
|
|
2022-09-23 15:04:13 +03:00
|
|
|
```catala-test-inline
|
|
|
|
$ catala Interpret -s A
|
|
|
|
[ERROR] Couldn't infer the enumeration name from lonely wildcard (wildcard cannot be used as single match case)
|
|
|
|
|
2023-04-17 19:07:22 +03:00
|
|
|
┌─⯈ tests/test_enum/bad/ambiguous_wildcard.catala_en:15.5-15.21:
|
2022-10-27 13:18:00 +03:00
|
|
|
└──┐
|
|
|
|
15 │ -- anything : 31
|
2022-12-14 17:45:13 +03:00
|
|
|
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
|
2022-10-27 13:18:00 +03:00
|
|
|
└─ Wildcard cannot be used as single match case
|
2022-09-23 15:10:07 +03:00
|
|
|
#return code 255#
|
2022-07-08 17:23:09 +03:00
|
|
|
```
|