From dc2401cedaef3514112dbd58a02d3126f2026897 Mon Sep 17 00:00:00 2001 From: Marcel van Lohuizen Date: Fri, 21 Aug 2020 10:57:19 +0200 Subject: [PATCH] internal/core/eval: verify issue 258 is fixed Fixes #285 Change-Id: I5059c435fa88eb8130927809703d7ebaaeed280e Reviewed-on: https://cue-review.googlesource.com/c/cue/+/6943 Reviewed-by: CUE cueckoo Reviewed-by: Marcel van Lohuizen --- cue/testdata/eval/issue285.txtar | 48 ++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 cue/testdata/eval/issue285.txtar diff --git a/cue/testdata/eval/issue285.txtar b/cue/testdata/eval/issue285.txtar new file mode 100644 index 000000000..6abbe4a00 --- /dev/null +++ b/cue/testdata/eval/issue285.txtar @@ -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" + } + }) +}