2022-03-06 19:34:51 +03:00
|
|
|
## 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
|
|
|
|
```
|
2022-07-08 17:23:09 +03:00
|
|
|
|
2022-09-23 15:04:13 +03:00
|
|
|
```catala-test-inline
|
|
|
|
$ catala Typecheck
|
2023-06-19 18:08:16 +03:00
|
|
|
[ERROR]
|
|
|
|
Cyclic dependency detected between the following variables of scope A:
|
|
|
|
foofoo@bar → foofoo@baz → foo@bar → foo@baz → foofoo@bar
|
2023-07-06 13:44:44 +03:00
|
|
|
|
2023-03-06 16:42:24 +03:00
|
|
|
foofoo@bar is used here in the definition of foofoo@baz:
|
2023-04-17 19:07:22 +03:00
|
|
|
┌─⯈ tests/test_variable_state/bad/state_cycle.catala_en:19.38-19.44:
|
2022-10-27 13:18:00 +03:00
|
|
|
└──┐
|
|
|
|
19 │ definition foofoo state baz equals foofoo + 1
|
|
|
|
│ ‾‾‾‾‾‾
|
|
|
|
└─ Test
|
2023-07-06 13:44:44 +03:00
|
|
|
|
2023-03-06 16:42:24 +03:00
|
|
|
foofoo@baz is used here in the definition of foo@bar:
|
2023-04-17 19:07:22 +03:00
|
|
|
┌─⯈ tests/test_variable_state/bad/state_cycle.catala_en:13.35-13.41:
|
2022-10-27 13:18:00 +03:00
|
|
|
└──┐
|
|
|
|
13 │ definition foo state bar equals foofoo
|
|
|
|
│ ‾‾‾‾‾‾
|
|
|
|
└─ Test
|
2023-07-06 13:44:44 +03:00
|
|
|
|
2023-03-06 16:42:24 +03:00
|
|
|
foo@bar is used here in the definition of foo@baz:
|
2023-04-17 19:07:22 +03:00
|
|
|
┌─⯈ tests/test_variable_state/bad/state_cycle.catala_en:15.35-15.38:
|
2022-10-27 13:18:00 +03:00
|
|
|
└──┐
|
|
|
|
15 │ definition foo state baz equals foo + 1
|
|
|
|
│ ‾‾‾
|
|
|
|
└─ Test
|
2023-07-06 13:44:44 +03:00
|
|
|
|
2023-03-06 16:42:24 +03:00
|
|
|
foo@baz is used here in the definition of foofoo@bar:
|
2023-04-17 19:07:22 +03:00
|
|
|
┌─⯈ tests/test_variable_state/bad/state_cycle.catala_en:17.38-17.41:
|
2022-10-27 13:18:00 +03:00
|
|
|
└──┐
|
|
|
|
17 │ definition foofoo state bar equals foo
|
|
|
|
│ ‾‾‾
|
|
|
|
└─ Test
|
2023-06-28 16:57:52 +03:00
|
|
|
#return code 123#
|
2022-07-08 17:23:09 +03:00
|
|
|
```
|