catala/tests/test_variable_state/bad/state_cycle.catala_en
Louis Gesbert 429911024c Add parseable line-column info to error messages
a quick fix for now, ideally we want an option for editor-friendly output.
But for now this is a very cheap way to at least have clickable error messages
which are a big time-saver.
2022-11-07 14:03:38 +01:00

83 lines
2.0 KiB
Plaintext

## Test
```catala
declaration scope A:
output foo content integer
state bar
state baz
output foofoo content integer
state bar
state baz
scope A:
definition foo state bar equals foofoo
definition foo state baz equals foo + 1
definition foofoo state bar equals foo
definition foofoo state baz equals foofoo + 1
```
```catala-test-inline
$ catala Typecheck
[ERROR] Cyclic dependency detected between variables of scope A!
Cycle variable foofoo.bar, declared:
--> tests/test_variable_state/bad/state_cycle.catala_en:9.10-13
|
9 | state bar
| ^^^
+ Test
Used here in the definition of another cycle variable foofoo.baz:
--> tests/test_variable_state/bad/state_cycle.catala_en:19.37-43
|
19 | definition foofoo state baz equals foofoo + 1
| ^^^^^^
+ Test
Cycle variable foofoo.baz, declared:
--> tests/test_variable_state/bad/state_cycle.catala_en:10.10-13
|
10 | state baz
| ^^^
+ Test
Used here in the definition of another cycle variable foo.bar:
--> tests/test_variable_state/bad/state_cycle.catala_en:13.34-40
|
13 | definition foo state bar equals foofoo
| ^^^^^^
+ Test
Cycle variable foo.bar, declared:
--> tests/test_variable_state/bad/state_cycle.catala_en:6.10-13
|
6 | state bar
| ^^^
+ Test
Used here in the definition of another cycle variable foo.baz:
--> tests/test_variable_state/bad/state_cycle.catala_en:15.34-37
|
15 | definition foo state baz equals foo + 1
| ^^^
+ Test
Cycle variable foo.baz, declared:
--> tests/test_variable_state/bad/state_cycle.catala_en:7.10-13
|
7 | state baz
| ^^^
+ Test
Used here in the definition of another cycle variable foofoo.bar:
--> tests/test_variable_state/bad/state_cycle.catala_en:17.37-40
|
17 | definition foofoo state bar equals foo
| ^^^
+ Test
#return code 255#
```