-
Notifications
You must be signed in to change notification settings - Fork 292
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cue/testdata: hoist let cycle errors
These are compile errors and thus halt further evaluating, obfuscating the results of the other tests. Signed-off-by: Marcel van Lohuizen <[email protected]> Change-Id: I362ba7441b5295654076934645e5e02bd5da9cf2
- Loading branch information
Showing
2 changed files
with
208 additions
and
84 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,115 @@ | ||
-- in.cue -- | ||
cycles: { | ||
a: { | ||
let A = { c: B } | ||
let B = A | ||
out: A | ||
} | ||
|
||
b: { | ||
let A = { c: B } | ||
let B = { A.c } | ||
out: A | ||
} | ||
|
||
issue1042: { | ||
#FullAdder: { | ||
// IN | ||
a: bool | ||
b: bool | ||
c: bool | ||
// OUT | ||
sum: bool | ||
carry: bool | ||
} | ||
|
||
#Add16: { | ||
a: [bool] * 16 | ||
b: [bool] * 16 | ||
out: [bool] * 16 | ||
|
||
let fulladders = [ | ||
for i in list.Range(0, 4, 1) { | ||
#FullAdder & {"a": a[i], "b": b[i], c: carries[i]} | ||
} | ||
] | ||
let carries = [ | ||
false, | ||
for i in list.Range(0, 4, 1) { fulladders[i].carry } | ||
] | ||
out: [ | ||
for i in list.Range(0, 4, 1) { fulladders[i].sum } | ||
] | ||
} | ||
} | ||
} | ||
-- out/compile -- | ||
cycles.a.let[].c.c: cyclic references in let clause or alias: | ||
./in.cue:3:18 | ||
cycles.b.let[].c.c: cyclic references in let clause or alias: | ||
./in.cue:9:18 | ||
cycles.issue1042.#Add16.let[]: reference "list" not found: | ||
./in.cue:31:18 | ||
cycles.issue1042.#Add16.let[].for[].c.for[]: reference "list" not found: | ||
./in.cue:31:18 | ||
cycles.issue1042.#Add16.let[].for[].c.for[].for[].c: cyclic references in let clause or alias: | ||
./in.cue:32:50 | ||
cycles.issue1042.#Add16.let[]: reference "list" not found: | ||
./in.cue:37:18 | ||
cycles.issue1042.#Add16.let[].for[].c: reference "list" not found: | ||
./in.cue:37:18 | ||
cycles.issue1042.#Add16.out: reference "list" not found: | ||
./in.cue:40:18 | ||
--- in.cue | ||
{ | ||
cycles: { | ||
a: { | ||
out: 〈0;let A〉 | ||
} | ||
b: { | ||
out: 〈0;let A〉 | ||
} | ||
issue1042: { | ||
#FullAdder: { | ||
a: bool | ||
b: bool | ||
c: bool | ||
sum: bool | ||
carry: bool | ||
} | ||
#Add16: { | ||
a: ([ | ||
bool, | ||
] * 16) | ||
b: ([ | ||
bool, | ||
] * 16) | ||
out: ([ | ||
bool, | ||
] * 16) | ||
out: [ | ||
for _, i in _|_(reference "list" not found).Range(0, 4, 1) { | ||
〈3;let fulladders〉[〈1;i〉].sum | ||
}, | ||
] | ||
} | ||
} | ||
} | ||
} | ||
-- out/eval -- | ||
cycles.a.let[].c.c: cyclic references in let clause or alias: | ||
./in.cue:3:18 | ||
cycles.b.let[].c.c: cyclic references in let clause or alias: | ||
./in.cue:9:18 | ||
cycles.issue1042.#Add16.let[]: reference "list" not found: | ||
./in.cue:31:18 | ||
cycles.issue1042.#Add16.let[].for[].c.for[]: reference "list" not found: | ||
./in.cue:31:18 | ||
cycles.issue1042.#Add16.let[].for[].c.for[].for[].c: cyclic references in let clause or alias: | ||
./in.cue:32:50 | ||
cycles.issue1042.#Add16.let[]: reference "list" not found: | ||
./in.cue:37:18 | ||
cycles.issue1042.#Add16.let[].for[].c: reference "list" not found: | ||
./in.cue:37:18 | ||
cycles.issue1042.#Add16.out: reference "list" not found: | ||
./in.cue:40:18 |