internal/core/eval: verify issue 353 is fixed
Fixed in new evaluator.
Fixes #353
Change-Id: Idadfc5024079254e0f66673788a872424c1f8e85
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/6941
Reviewed-by: CUE cueckoo <cueckoo@gmail.com>
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
diff --git a/cue/testdata/eval/issue353.txtar b/cue/testdata/eval/issue353.txtar
new file mode 100644
index 0000000..10216af
--- /dev/null
+++ b/cue/testdata/eval/issue353.txtar
@@ -0,0 +1,38 @@
+-- in.cue --
+e: #Example
+
+e: a: "hello"
+
+#Example: {
+ a: string
+ {
+ value?: string
+ } | {
+ externalValue?: string
+ }
+}
+-- out/eval --
+(struct){
+ e: (#struct){
+ a: (string){ "hello" }
+ }
+ #Example: (#struct){
+ a: (string){ string }
+ }
+}
+-- out/compile --
+--- in.cue
+{
+ e: 〈0;#Example〉
+ e: {
+ a: "hello"
+ }
+ #Example: {
+ a: string
+ ({
+ value?: string
+ }|{
+ externalValue?: string
+ })
+ }
+}