-
Notifications
You must be signed in to change notification settings - Fork 276
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/core/eval: fix spurious cycle for bulk constraints
Fixes #502 Change-Id: I697007d0f7d0fabfedb919c10f4a044b1a6b45de Reviewed-on: https://cue-review.googlesource.com/c/cue/+/7501 Reviewed-by: CUE cueckoo <cueckoo@gmail.com> Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
- Loading branch information
Showing
5 changed files
with
729 additions
and
64 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,236 @@ | ||
-- in.cue -- | ||
#T : { | ||
config: _ | ||
body: _ | ||
mas: [string]: { | ||
cfg: _ | ||
_link: #T | ||
link: _link & {config: cfg} | ||
} | ||
} | ||
|
||
#a: #T & { | ||
config: a: int | ||
body: config.a | ||
mas: one: { | ||
cfg: b: config.a | ||
_link: { | ||
config: b: int | ||
body: config.b | ||
mas: two : { | ||
cfg: c: config.b | ||
_link: { | ||
config: c: int | ||
body: config.c | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
a: #a & {config: a: 34} | ||
-- out/eval -- | ||
(struct){ | ||
#T: (#struct){ | ||
config: (_){ _ } | ||
body: (_){ _ } | ||
mas: (#struct){ | ||
} | ||
} | ||
#a: (#struct){ | ||
config: (#struct){ | ||
a: (int){ int } | ||
} | ||
body: (int){ int } | ||
mas: (#struct){ | ||
one: (#struct){ | ||
cfg: (#struct){ | ||
b: (int){ int } | ||
} | ||
_link: (#struct){ | ||
config: (#struct){ | ||
b: (int){ int } | ||
} | ||
body: (int){ int } | ||
mas: (#struct){ | ||
two: (#struct){ | ||
cfg: (#struct){ | ||
c: (int){ int } | ||
} | ||
_link: (#struct){ | ||
config: (#struct){ | ||
c: (int){ int } | ||
} | ||
body: (int){ int } | ||
mas: (#struct){ | ||
} | ||
} | ||
link: (#struct){ | ||
config: (#struct){ | ||
c: (int){ int } | ||
} | ||
body: (int){ int } | ||
mas: (#struct){ | ||
} | ||
} | ||
} | ||
} | ||
} | ||
link: (#struct){ | ||
config: (#struct){ | ||
b: (int){ int } | ||
} | ||
body: (int){ int } | ||
mas: (#struct){ | ||
two: (#struct){ | ||
cfg: (#struct){ | ||
c: (int){ int } | ||
} | ||
_link: (#struct){ | ||
config: (#struct){ | ||
c: (int){ int } | ||
} | ||
body: (int){ int } | ||
mas: (#struct){ | ||
} | ||
} | ||
link: (#struct){ | ||
config: (#struct){ | ||
c: (int){ int } | ||
} | ||
body: (int){ int } | ||
mas: (#struct){ | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
a: (#struct){ | ||
config: (#struct){ | ||
a: (int){ 34 } | ||
} | ||
body: (int){ 34 } | ||
mas: (#struct){ | ||
one: (#struct){ | ||
cfg: (#struct){ | ||
b: (int){ 34 } | ||
} | ||
_link: (#struct){ | ||
config: (#struct){ | ||
b: (int){ int } | ||
} | ||
body: (int){ int } | ||
mas: (#struct){ | ||
two: (#struct){ | ||
cfg: (#struct){ | ||
c: (int){ int } | ||
} | ||
_link: (#struct){ | ||
config: (#struct){ | ||
c: (int){ int } | ||
} | ||
body: (int){ int } | ||
mas: (#struct){ | ||
} | ||
} | ||
link: (#struct){ | ||
config: (#struct){ | ||
c: (int){ int } | ||
} | ||
body: (int){ int } | ||
mas: (#struct){ | ||
} | ||
} | ||
} | ||
} | ||
} | ||
link: (#struct){ | ||
config: (#struct){ | ||
b: (int){ 34 } | ||
} | ||
body: (int){ 34 } | ||
mas: (#struct){ | ||
two: (#struct){ | ||
cfg: (#struct){ | ||
c: (int){ 34 } | ||
} | ||
_link: (#struct){ | ||
config: (#struct){ | ||
c: (int){ int } | ||
} | ||
body: (int){ int } | ||
mas: (#struct){ | ||
} | ||
} | ||
link: (#struct){ | ||
config: (#struct){ | ||
c: (int){ 34 } | ||
} | ||
body: (int){ 34 } | ||
mas: (#struct){ | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
-- out/compile -- | ||
--- in.cue | ||
{ | ||
#T: { | ||
config: _ | ||
body: _ | ||
mas: { | ||
[string]: { | ||
cfg: _ | ||
_link: 〈3;#T〉 | ||
link: (〈0;_link〉 & { | ||
config: 〈1;cfg〉 | ||
}) | ||
} | ||
} | ||
} | ||
#a: (〈0;#T〉 & { | ||
config: { | ||
a: int | ||
} | ||
body: 〈0;config〉.a | ||
mas: { | ||
one: { | ||
cfg: { | ||
b: 〈3;config〉.a | ||
} | ||
_link: { | ||
config: { | ||
b: int | ||
} | ||
body: 〈0;config〉.b | ||
mas: { | ||
two: { | ||
cfg: { | ||
c: 〈3;config〉.b | ||
} | ||
_link: { | ||
config: { | ||
c: int | ||
} | ||
body: 〈0;config〉.c | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}) | ||
a: (〈0;#a〉 & { | ||
config: { | ||
a: 34 | ||
} | ||
}) | ||
} |
Oops, something went wrong.