-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f70f58e
commit d26bef4
Showing
5 changed files
with
120 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
## [Article] | ||
|
||
```catala | ||
new scope S: | ||
param a content A | ||
param b content B | ||
new struct A: | ||
data x content int | ||
data y content B | ||
new struct B: | ||
data y content bool | ||
data z content dec | ||
scope S: | ||
def b := B { -- y: true -- z: 0.0} | ||
def a := A { -- x: 0 -- y : b } | ||
``` |
3 changes: 3 additions & 0 deletions
3
tests/test_name_resolution/good/output/out_of_order.catala.S.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[RESULT] Computation successful! Results: | ||
[RESULT] a = A {"x": 0, "y": B {"y": true, "z": 0.}} | ||
[RESULT] b = B {"y": true, "z": 0.} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,7 @@ new struct S: | |
new enum E: | ||
-- Case1 content bool | ||
-- Case2 content S | ||
new scope A: | ||
param x content E | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,29 @@ | ||
[ERROR] Unknown type "E", not a struct or enum previously declared | ||
[ERROR] Cyclic dependency detected between types! | ||
[ERROR] | ||
[ERROR] Cycle type S, declared: | ||
[ERROR] --> test_struct/bad/nested2.catala | ||
[ERROR] | | ||
[ERROR] 5 | data x content E | ||
[ERROR] 4 | new struct S: | ||
[ERROR] | ^ | ||
[ERROR] + Article | ||
[ERROR] | ||
[ERROR] Used here in the definition of another cycle type E: | ||
[ERROR] --> test_struct/bad/nested2.catala | ||
[ERROR] | | ||
[ERROR] 10 | -- Case2 content S | ||
[ERROR] | ^ | ||
[ERROR] + Article | ||
[ERROR] | ||
[ERROR] Cycle type E, declared: | ||
[ERROR] --> test_struct/bad/nested2.catala | ||
[ERROR] | | ||
[ERROR] 8 | new enum E: | ||
[ERROR] | ^ | ||
[ERROR] + Article | ||
[ERROR] | ||
[ERROR] Used here in the definition of another cycle type S: | ||
[ERROR] --> test_struct/bad/nested2.catala | ||
[ERROR] | | ||
[ERROR] 5 | data x content E | ||
[ERROR] | ^ | ||
[ERROR] + Article |