catala/tests/test_scope/bad/cycle_in_scope.catala_en

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

63 lines
1.6 KiB
Plaintext
Raw Normal View History

## Article
```catala
declaration scope A:
context x content integer
context y content integer
context z content integer
scope A:
definition y under condition x < 0 consequence equals - x
definition y under condition x >= 0 consequence equals x
definition z under condition y >= 1 consequence equals 10 / y
definition z under condition y < 1 consequence equals y
definition x equals z
```
```catala-test-inline
$ catala Interpret -s A
[ERROR] Cyclic dependency detected between variables of scope A!
Cycle variable z, declared:
--> tests/test_scope/bad/cycle_in_scope.catala_en
|
7 | context z content integer
| ^
+ Article
Used here in the definition of another cycle variable x:
--> tests/test_scope/bad/cycle_in_scope.catala_en
|
14 | definition x equals z
| ^
+ Article
Cycle variable y, declared:
--> tests/test_scope/bad/cycle_in_scope.catala_en
|
6 | context y content integer
| ^
+ Article
Used here in the definition of another cycle variable z:
--> tests/test_scope/bad/cycle_in_scope.catala_en
|
13 | definition z under condition y < 1 consequence equals y
| ^
+ Article
Cycle variable x, declared:
--> tests/test_scope/bad/cycle_in_scope.catala_en
|
5 | context x content integer
| ^
+ Article
Used here in the definition of another cycle variable y:
--> tests/test_scope/bad/cycle_in_scope.catala_en
|
11 | definition y under condition x >= 0 consequence equals x
| ^
+ Article
```