Skip to content

Commit

Permalink
internal/core/eval: verify issue 258 is fixed
Browse files Browse the repository at this point in the history
Fixes #285

Change-Id: I5059c435fa88eb8130927809703d7ebaaeed280e
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/6943
Reviewed-by: CUE cueckoo <cueckoo@gmail.com>
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
  • Loading branch information
mpvl committed Aug 21, 2020
1 parent ea5d964 commit dc2401c
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions cue/testdata/eval/issue285.txtar
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
-- in.cue --
#TopLevel: [name=string]: {
path: string
content: string
}

#Mid: #TopLevel & {
myoutput: path: "/output"
}

val: #Mid & {} & {myoutput: {content: "foo"}} // Should work.
-- out/eval --
(struct){
#TopLevel: (#struct){
}
#Mid: (#struct){
myoutput: (#struct){
path: (string){ "/output" }
content: (string){ string }
}
}
val: (#struct){
myoutput: (#struct){
path: (string){ "/output" }
content: (string){ "foo" }
}
}
}
-- out/compile --
--- in.cue
{
#TopLevel: {
[string]: {
path: string
content: string
}
}
#Mid: (〈0;#TopLevel〉 & {
myoutput: {
path: "/output"
}
})
val: ((〈0;#Mid〉 & {}) & {
myoutput: {
content: "foo"
}
})
}

0 comments on commit dc2401c

Please sign in to comment.