diff --git a/cue/testdata/cycle/comprehension.txtar b/cue/testdata/cycle/comprehension.txtar index 8e3578bc5e6..a100b75b107 100644 --- a/cue/testdata/cycle/comprehension.txtar +++ b/cue/testdata/cycle/comprehension.txtar @@ -310,15 +310,15 @@ issue2367: { } -- out/evalalpha/stats -- -Leaks: 782 -Freed: 63 -Reused: 63 -Allocs: 782 +Leaks: 795 +Freed: 56 +Reused: 56 +Allocs: 795 Retain: 0 -Unifications: 502 -Conjuncts: 3031 -Disjuncts: 196 +Unifications: 506 +Conjuncts: 3038 +Disjuncts: 198 -- out/evalalpha -- Errors: selfReferential.insertionError.A: adding field foo3 not allowed as field set was already referenced: @@ -450,11 +450,31 @@ Result: acrossOr: (struct){ t1: (struct){ p1: (struct){ - o: (#struct){ - retry: (#struct){ - reject: (string){ "ok" } - } - } + o: (#struct){ |((#struct){ + retry: (struct){ + reject: (string){ "ok" } + } + reject: (string){ string } + }, (#struct){ + retry: (struct){ + reject: (string){ "ok" } + } + resource: (string){ string } + }, (#struct){ + retry: (#struct){ |((#struct){ + reject: (string){ "ok" } + }, (#struct){ + reject: (string){ "ok" } + resource: (string){ string } + }, (#struct){ + reject: (string){ "ok" } + retry: (#struct){ |((#struct){ + reject: (string){ string } + }, (#struct){ + resource: (string){ string } + }) } + }) } + }) } #AllOutputs: (#struct){ reject: (string){ string } resource: (string){ string } @@ -568,13 +588,33 @@ Result: } issue1881: (struct){ p1: (struct){ - o: (#struct){ - retry: (struct){ - output: (#struct){ - reject: (string){ "ok" } + o: (#struct){ |((#struct){ + retry: (struct){ + output: (struct){ + reject: (string){ "ok" } + } } - } - } + reject: (string){ string } + }, (#struct){ + retry: (struct){ + output: (struct){ + reject: (string){ "ok" } + } + } + resource: (string){ string } + }, (#struct){ + retry: (struct){ + output: (#struct){ |((#struct){ + reject: (string){ "ok" } + }, (#struct){ + reject: (string){ "ok" } + resource: (string){ string } + }, (#struct){ + reject: (string){ "ok" } + retry: ~(issue1881.p1.#AllOutputs.retry) + }) } + } + }) } #AllOutputs: (#struct){ reject: (string){ string } resource: (string){ string } @@ -778,7 +818,7 @@ diff old new } } } -@@ -127,9 +120,9 @@ +@@ -127,19 +120,39 @@ insertionError: (_|_){ // [eval] A: (_|_){ @@ -790,10 +830,46 @@ diff old new } } acrossOr: (struct){ -@@ -254,27 +247,31 @@ + t1: (struct){ + p1: (struct){ +- o: (#struct){ +- retry: (#struct){ +- reject: (string){ "ok" } +- } +- } ++ o: (#struct){ |((#struct){ ++ retry: (struct){ ++ reject: (string){ "ok" } ++ } ++ reject: (string){ string } ++ }, (#struct){ ++ retry: (struct){ ++ reject: (string){ "ok" } ++ } ++ resource: (string){ string } ++ }, (#struct){ ++ retry: (#struct){ |((#struct){ ++ reject: (string){ "ok" } ++ }, (#struct){ ++ reject: (string){ "ok" } ++ resource: (string){ string } ++ }, (#struct){ ++ reject: (string){ "ok" } ++ retry: (#struct){ |((#struct){ ++ reject: (string){ string } ++ }, (#struct){ ++ resource: (string){ string } ++ }) } ++ }) } ++ }) } + #AllOutputs: (#struct){ + reject: (string){ string } + resource: (string){ string } +@@ -253,28 +266,52 @@ + } issue1881: (struct){ p1: (struct){ - o: (#struct){ +- o: (#struct){ - retry: (#struct){ - output: (#struct){ - reject: (string){ "ok" } @@ -815,12 +891,33 @@ diff old new - reject: (string){ string } - }, (#struct){ - resource: (string){ string } -+ retry: (struct){ -+ output: (#struct){ -+ reject: (string){ "ok" } ++ o: (#struct){ |((#struct){ ++ retry: (struct){ ++ output: (struct){ ++ reject: (string){ "ok" } ++ } + } -+ } -+ } ++ reject: (string){ string } ++ }, (#struct){ ++ retry: (struct){ ++ output: (struct){ ++ reject: (string){ "ok" } ++ } ++ } ++ resource: (string){ string } ++ }, (#struct){ ++ retry: (struct){ ++ output: (#struct){ |((#struct){ ++ reject: (string){ "ok" } ++ }, (#struct){ ++ reject: (string){ "ok" } ++ resource: (string){ string } ++ }, (#struct){ ++ reject: (string){ "ok" } ++ retry: ~(issue1881.p1.#AllOutputs.retry) ++ }) } ++ } ++ }) } + #AllOutputs: (#struct){ + reject: (string){ string } + resource: (string){ string } @@ -843,7 +940,7 @@ diff old new }) } } p2: (struct){ -@@ -290,7 +287,7 @@ +@@ -290,7 +327,7 @@ } } o: (#struct){ @@ -852,7 +949,7 @@ diff old new output: (#struct){ reject: (string){ "ok" } } -@@ -320,7 +317,7 @@ +@@ -320,7 +357,7 @@ resource: (string){ string } }) } o: (#struct){ @@ -871,18 +968,18 @@ diff old new -Reused: 1260 -Allocs: 60 -Retain: 145 -+Leaks: 782 -+Freed: 63 -+Reused: 63 -+Allocs: 782 ++Leaks: 795 ++Freed: 56 ++Reused: 56 ++Allocs: 795 +Retain: 0 -Unifications: 832 -Conjuncts: 2525 -Disjuncts: 1404 -+Unifications: 502 -+Conjuncts: 3031 -+Disjuncts: 196 ++Unifications: 506 ++Conjuncts: 3038 ++Disjuncts: 198 -- out/eval/stats -- Leaks: 50 Freed: 1270 diff --git a/cue/testdata/cycle/issue990.txtar b/cue/testdata/cycle/issue990.txtar index ee2465e446f..db79b9c2736 100644 --- a/cue/testdata/cycle/issue990.txtar +++ b/cue/testdata/cycle/issue990.txtar @@ -80,15 +80,15 @@ out: #sub & {#p: _test.s1} -- diff/todo/p3 -- Reordering -- out/evalalpha/stats -- -Leaks: 1834 -Freed: 197 -Reused: 197 -Allocs: 1834 +Leaks: 1909 +Freed: 204 +Reused: 204 +Allocs: 1909 Retain: 0 -Unifications: 243 -Conjuncts: 4474 -Disjuncts: 396 +Unifications: 257 +Conjuncts: 4823 +Disjuncts: 410 -- out/evalalpha -- (struct){ #AC: (#struct){ @@ -328,18 +328,18 @@ diff old new -Reused: 3213 -Allocs: 25 -Retain: 26 -+Leaks: 1834 -+Freed: 197 -+Reused: 197 -+Allocs: 1834 ++Leaks: 1909 ++Freed: 204 ++Reused: 204 ++Allocs: 1909 +Retain: 0 -Unifications: 2588 -Conjuncts: 12056 -Disjuncts: 3258 -+Unifications: 243 -+Conjuncts: 4474 -+Disjuncts: 396 ++Unifications: 257 ++Conjuncts: 4823 ++Disjuncts: 410 -- diff/-out/evalalpha<==>+out/eval -- diff old new --- old diff --git a/cue/testdata/disjunctions/elimination.txtar b/cue/testdata/disjunctions/elimination.txtar index d847085b0f0..e6869168a4a 100644 --- a/cue/testdata/disjunctions/elimination.txtar +++ b/cue/testdata/disjunctions/elimination.txtar @@ -713,7 +713,7 @@ issue3528: nested: t2: { preserveClosedness: (struct){ small: (struct){ p1: (struct){ - #A: (#struct){ |((#struct){ + #A: (#struct){ |(*(#struct){ a: (string){ string } }, (#struct){ a: (string){ string } @@ -730,7 +730,7 @@ issue3528: nested: t2: { }) } } p2: (struct){ - #A: (#struct){ |((#struct){ + #A: (#struct){ |(*(#struct){ a: (string){ string } }, (#struct){ a: (string){ string } @@ -749,7 +749,7 @@ issue3528: nested: t2: { } medium: (struct){ p1: (struct){ - #A: (#struct){ |((#struct){ + #A: (#struct){ |(*(#struct){ a: (string){ string } }, (#struct){ a: (string){ string } @@ -757,6 +757,17 @@ issue3528: nested: t2: { }, (#struct){ a: (string){ string } d: (string){ string } + }, (#struct){ + a: (string){ string } + b: (string){ string } + }, (#struct){ + a: (string){ string } + b: (string){ string } + c: (int){ int } + }, (#struct){ + a: (string){ string } + b: (string){ string } + d: (string){ string } }) } #B: (#struct){ |(*(#struct){ }, (#struct){ @@ -782,13 +793,24 @@ issue3528: nested: t2: { }) } } p2: (struct){ - #A: (#struct){ |((#struct){ + #A: (#struct){ |(*(#struct){ + a: (string){ string } + }, (#struct){ + a: (string){ string } + c: (int){ int } + }, (#struct){ + a: (string){ string } + d: (string){ string } + }, (#struct){ a: (string){ string } + b: (string){ string } }, (#struct){ a: (string){ string } + b: (string){ string } c: (int){ int } }, (#struct){ a: (string){ string } + b: (string){ string } d: (string){ string } }) } #B: (#struct){ |(*(#struct){ @@ -815,7 +837,7 @@ issue3528: nested: t2: { }) } } p3: (struct){ - #A: (#struct){ |((#struct){ + #A: (#struct){ |(*(#struct){ a: (string){ string } }, (#struct){ a: (string){ string } @@ -823,6 +845,17 @@ issue3528: nested: t2: { }, (#struct){ a: (string){ string } d: (string){ string } + }, (#struct){ + a: (string){ string } + b: (string){ string } + }, (#struct){ + a: (string){ string } + b: (string){ string } + c: (int){ int } + }, (#struct){ + a: (string){ string } + b: (string){ string } + d: (string){ string } }) } #B: (#struct){ |(*(#struct){ }, (#struct){ @@ -872,9 +905,12 @@ issue3528: nested: t2: { } } t2: (struct){ - o: (#struct){ - b: (string){ "test" } - } + o: (#struct){ |((#struct){ + b: (string){ "test" } + }, (#struct){ + b: (string){ "test" } + c: ~(noChildError.t2.#D) + }) } #D: (#struct){ b: (string){ string } } @@ -890,9 +926,19 @@ issue3528: nested: t2: { } } t4: (struct){ - o: (#struct){ - b: (string){ "test" } - } + o: (#struct){ |((#struct){ + b: (string){ "test" } + a: (null){ null } + }, (#struct){ + b: (string){ "test" } + }, (#struct){ + b: (string){ "test" } + c: (#struct){ |((#struct){ + a: (null){ null } + }, (#struct){ + b: (string){ string } + }) } + }) } #D: (#struct){ |((#struct){ a: (null){ null } }, (#struct){ @@ -1050,15 +1096,34 @@ issue3528: nested: t2: { } full: (struct){ Foo: (#struct){ - spec: (#struct){ - foo: (#struct){ - min: (int){ |(*(int){ 10 }, (int){ int }) } - max: (int){ |(*(int){ 20 }, (int){ int }) } - } - } + spec: (#struct){ |(*(#struct){ + foo: (#struct){ + min: (int){ |(*(int){ 10 }, (int){ int }) } + max: (int){ |(*(int){ 20 }, (int){ int }) } + } + }, (#struct){ + foo: (struct){ + } + bar: (#struct){ + min: (int){ |(*(int){ 30 }, (int){ int }) } + max: (int){ |(*(int){ 40 }, (int){ int }) } + } + }) } resource: (#struct){ _X: (#struct){ - spec: ~(issue2209.full.Foo.spec) + spec: (#struct){ |(*(#struct){ + foo: (#struct){ + min: (int){ |(*(int){ 10 }, (int){ int }) } + max: (int){ |(*(int){ 20 }, (int){ int }) } + } + }, (#struct){ + foo: (struct){ + } + bar: (#struct){ + min: (int){ |(*(int){ 30 }, (int){ int }) } + max: (int){ |(*(int){ 40 }, (int){ int }) } + } + }) } } spec: (#struct){ |(*(#struct){ minFoo: (int){ |(*(int){ 10 }, (int){ int }) } @@ -1578,61 +1643,10 @@ diff old new // ./in.cue:138:15 // ./in.cue:124:15 // ./in.cue:125:12 -@@ -205,24 +151,24 @@ - preserveClosedness: (struct){ - small: (struct){ - p1: (struct){ -- #A: (#struct){ |(*(#struct){ -- a: (string){ string } -- }, (#struct){ -- a: (string){ string } -- b: (int){ int } -- }) } -- #B: (#struct){ |(*(#struct){ -- }, (#struct){ -- b: (int){ int } -- }, (#struct){ -- a: (string){ string } -- }, (#struct){ -- a: (string){ string } -- b: (int){ int } -- }) } -- } -- p2: (struct){ -- #A: (#struct){ |(*(#struct){ -+ #A: (#struct){ |((#struct){ -+ a: (string){ string } -+ }, (#struct){ -+ a: (string){ string } -+ b: (int){ int } -+ }) } -+ #B: (#struct){ |(*(#struct){ -+ }, (#struct){ -+ b: (int){ int } -+ }, (#struct){ -+ a: (string){ string } -+ }, (#struct){ -+ a: (string){ string } -+ b: (int){ int } -+ }) } -+ } -+ p2: (struct){ -+ #A: (#struct){ |((#struct){ - a: (string){ string } +@@ -249,38 +195,60 @@ }, (#struct){ a: (string){ string } -@@ -241,40 +187,40 @@ - } - medium: (struct){ - p1: (struct){ -- #A: (#struct){ |(*(#struct){ -- a: (string){ string } -- }, (#struct){ -- a: (string){ string } -- c: (int){ int } -- }, (#struct){ -- a: (string){ string } -- d: (string){ string } + d: (string){ string } - }) } - #B: (#struct){ |(*(#struct){ - }, (#struct){ @@ -1659,13 +1673,22 @@ diff old new - } - p2: (struct){ - #A: (#struct){ |(*(#struct){ -+ #A: (#struct){ |((#struct){ +- a: (string){ string } +- }, (#struct){ +- a: (string){ string } +- c: (int){ int } +- }, (#struct){ +- a: (string){ string } ++ }, (#struct){ + a: (string){ string } ++ b: (string){ string } + }, (#struct){ + a: (string){ string } ++ b: (string){ string } + c: (int){ int } + }, (#struct){ + a: (string){ string } ++ b: (string){ string } + d: (string){ string } + }) } + #B: (#struct){ |(*(#struct){ @@ -1692,20 +1715,46 @@ diff old new + }) } + } + p2: (struct){ -+ #A: (#struct){ |((#struct){ - a: (string){ string } ++ #A: (#struct){ |(*(#struct){ ++ a: (string){ string } ++ }, (#struct){ ++ a: (string){ string } ++ c: (int){ int } ++ }, (#struct){ ++ a: (string){ string } ++ d: (string){ string } ++ }, (#struct){ ++ a: (string){ string } ++ b: (string){ string } ++ }, (#struct){ ++ a: (string){ string } ++ b: (string){ string } ++ c: (int){ int } ++ }, (#struct){ ++ a: (string){ string } ++ b: (string){ string } + d: (string){ string } + }) } + #B: (#struct){ |(*(#struct){ +@@ -315,6 +283,17 @@ }, (#struct){ a: (string){ string } -@@ -307,7 +253,7 @@ + d: (string){ string } ++ }, (#struct){ ++ a: (string){ string } ++ b: (string){ string } ++ }, (#struct){ ++ a: (string){ string } ++ b: (string){ string } ++ c: (int){ int } ++ }, (#struct){ ++ a: (string){ string } ++ b: (string){ string } ++ d: (string){ string } }) } - } - p3: (struct){ -- #A: (#struct){ |(*(#struct){ -+ #A: (#struct){ |((#struct){ - a: (string){ string } + #B: (#struct){ |(*(#struct){ }, (#struct){ - a: (string){ string } -@@ -349,10 +295,6 @@ +@@ -349,10 +328,6 @@ #type: (#struct){ fieldName: ((string|struct)){ |((string){ string }, (#struct){ foo: (string){ string } @@ -1716,7 +1765,46 @@ diff old new }) } } #subtype: ((string|struct)){ |((string){ string }, (#struct){ -@@ -432,12 +374,8 @@ +@@ -368,9 +343,12 @@ + } + } + t2: (struct){ +- o: (#struct){ +- b: (string){ "test" } +- } ++ o: (#struct){ |((#struct){ ++ b: (string){ "test" } ++ }, (#struct){ ++ b: (string){ "test" } ++ c: ~(noChildError.t2.#D) ++ }) } + #D: (#struct){ + b: (string){ string } + } +@@ -386,9 +364,19 @@ + } + } + t4: (struct){ +- o: (#struct){ +- b: (string){ "test" } +- } ++ o: (#struct){ |((#struct){ ++ b: (string){ "test" } ++ a: (null){ null } ++ }, (#struct){ ++ b: (string){ "test" } ++ }, (#struct){ ++ b: (string){ "test" } ++ c: (#struct){ |((#struct){ ++ a: (null){ null } ++ }, (#struct){ ++ b: (string){ string } ++ }) } ++ }) } + #D: (#struct){ |((#struct){ + a: (null){ null } + }, (#struct){ +@@ -432,12 +420,8 @@ #T: (list){ 0: (string){ "d" } } @@ -1731,7 +1819,7 @@ diff old new } issue1940: (struct){ #T: (#list){ -@@ -446,53 +384,24 @@ +@@ -446,53 +430,24 @@ } } #A: (#struct){ @@ -1797,7 +1885,7 @@ diff old new t1: (struct){ #SpecFoo: (#struct){ foo: (#struct){ -@@ -510,36 +419,20 @@ +@@ -510,36 +465,20 @@ } } out: (struct){ |((struct){ @@ -1848,7 +1936,7 @@ diff old new nullBar: (null){ null } }) } } -@@ -555,48 +448,45 @@ +@@ -555,185 +494,118 @@ x: (int){ 1 } } } @@ -1934,12 +2022,13 @@ diff old new + } + full: (struct){ Foo: (#struct){ - spec: (#struct){ - foo: (#struct){ -@@ -605,135 +495,52 @@ - } - } - resource: (#struct){ +- spec: (#struct){ +- foo: (#struct){ +- min: (int){ |(*(int){ 10 }, (int){ int }) } +- max: (int){ |(*(int){ 20 }, (int){ int }) } +- } +- } +- resource: (#struct){ - spec: (#struct){ |(*(#struct){ - minFoo: (int){ |(*(int){ 10 }, (int){ int }) } - maxFoo: (int){ |(*(int){ 20 }, (int){ int }) } @@ -2069,8 +2158,34 @@ diff old new - } - }) } - } ++ spec: (#struct){ |(*(#struct){ ++ foo: (#struct){ ++ min: (int){ |(*(int){ 10 }, (int){ int }) } ++ max: (int){ |(*(int){ 20 }, (int){ int }) } ++ } ++ }, (#struct){ ++ foo: (struct){ ++ } ++ bar: (#struct){ ++ min: (int){ |(*(int){ 30 }, (int){ int }) } ++ max: (int){ |(*(int){ 40 }, (int){ int }) } ++ } ++ }) } ++ resource: (#struct){ + _X: (#struct){ -+ spec: ~(issue2209.full.Foo.spec) ++ spec: (#struct){ |(*(#struct){ ++ foo: (#struct){ ++ min: (int){ |(*(int){ 10 }, (int){ int }) } ++ max: (int){ |(*(int){ 20 }, (int){ int }) } ++ } ++ }, (#struct){ ++ foo: (struct){ ++ } ++ bar: (#struct){ ++ min: (int){ |(*(int){ 30 }, (int){ int }) } ++ max: (int){ |(*(int){ 40 }, (int){ int }) } ++ } ++ }) } + } + spec: (#struct){ |(*(#struct){ + minFoo: (int){ |(*(int){ 10 }, (int){ int }) } @@ -2118,7 +2233,7 @@ diff old new } } #Abstract: (#struct){ -@@ -749,34 +556,34 @@ +@@ -749,34 +621,34 @@ } }) } resource: (#struct){ @@ -2181,7 +2296,7 @@ diff old new } } _#Spec: (#struct){ |(*(#struct){ -@@ -803,36 +610,36 @@ +@@ -803,36 +675,36 @@ } } _Thing: (#struct){ @@ -2247,7 +2362,7 @@ diff old new } #Constrained: (#struct){ spec: (#struct){ |(*(#struct){ -@@ -916,19 +723,19 @@ +@@ -916,19 +788,19 @@ common: (int){ 3 } } #FormFoo: (#struct){ @@ -2274,7 +2389,7 @@ diff old new }) } } #Input: (#struct){ -@@ -936,18 +743,12 @@ +@@ -936,18 +808,12 @@ } } #summarizeReturn: (#struct){ @@ -2295,7 +2410,7 @@ diff old new out: (#list){ } } -@@ -977,10 +778,23 @@ +@@ -977,10 +843,23 @@ } full: (struct){ metrics: (#list){ @@ -2323,7 +2438,7 @@ diff old new 1: (#struct){ id: (string){ "bar" } value: (int){ 80 } -@@ -1031,13 +845,11 @@ +@@ -1031,13 +910,11 @@ } } } @@ -2339,7 +2454,7 @@ diff old new 0: (#struct){ name: (string){ "FooBarFoo" } } -@@ -1047,19 +859,8 @@ +@@ -1047,19 +924,8 @@ 2: (#struct){ name: (string){ "FooQuuxFoo" } } @@ -2361,7 +2476,7 @@ diff old new } } } -@@ -1134,10 +935,10 @@ +@@ -1134,10 +1000,10 @@ v: (string){ |(*(string){ "a" }, (string){ "b" }, (string){ "c" }) } } c: (#struct){ diff --git a/cue/testdata/eval/disjunctions.txtar b/cue/testdata/eval/disjunctions.txtar index 8f45e9bca78..2205ebb6f1e 100644 --- a/cue/testdata/eval/disjunctions.txtar +++ b/cue/testdata/eval/disjunctions.txtar @@ -204,16 +204,39 @@ issue3597: t2: { } foo: X & {X} } +-- dependencies.cue -- +issue3606: { + data: { + notAllowed: true + } & #S + + #S: string | {} +} +issue3672: { + #A: string | {y: true} + #B: #A | {a: "append"} | {b: "prepend"} + + #fn: { + #C: #B + #out: x: [...#C] + } + + // The unification inline appears to be critical + #def: (#fn & {}).#out + + v: #def + v: x: [{y: true}] // Should be one element +} -- out/eval/stats -- -Leaks: 8 -Freed: 561 -Reused: 547 -Allocs: 22 -Retain: 34 +Leaks: 10 +Freed: 625 +Reused: 611 +Allocs: 24 +Retain: 39 -Unifications: 286 -Conjuncts: 1125 -Disjuncts: 571 +Unifications: 326 +Conjuncts: 1213 +Disjuncts: 640 -- out/evalalpha -- Errors: f: 2 errors in empty disjunction: @@ -227,6 +250,55 @@ f.val: conflicting values 3 and string (mismatched types int and string): Result: (_|_){ // [eval] + issue3606: (struct){ + data: (#struct){ + notAllowed: (bool){ true } + } + #S: ((string|struct)){ |((string){ string }, (#struct){ + }) } + } + issue3672: (struct){ + #A: ((string|struct)){ |((string){ string }, (#struct){ + y: (bool){ true } + }) } + #B: ((string|struct)){ |((string){ string }, (#struct){ + y: (bool){ true } + }, (#struct){ + a: (string){ "append" } + }, (#struct){ + b: (string){ "prepend" } + }) } + #fn: (#struct){ + #C: ((string|struct)){ |((string){ string }, (#struct){ + y: (bool){ true } + }, (#struct){ + a: (string){ "append" } + }, (#struct){ + b: (string){ "prepend" } + }) } + #out: (#struct){ + x: (list){ + } + } + } + #def: (#struct){ + x: (list){ + } + } + v: (#struct){ + x: (#list){ + 0: (#struct){ |((#struct){ + y: (bool){ true } + }, (#struct){ + y: (bool){ true } + a: (string){ "append" } + }, (#struct){ + y: (bool){ true } + b: (string){ "prepend" } + }) } + } + } + } a: (int){ |(*(int){ 1 }, (int){ int }) } aa: (int){ |(*(int){ 1 }, *(int){ 2 }, (int){ int }) } b: (struct){ |((struct){ @@ -475,7 +547,7 @@ Result: let Ok#1 = (bool){ true } }, (#struct){ _ok: (bool){ true } - let Ok#1multi = 〈0;_ok〉 + let Ok#1 = (bool){ true } x: (bool){ true } }) } bar: (#struct){ |((#struct){ @@ -512,7 +584,7 @@ Result: diff old new --- old +++ new -@@ -2,11 +2,9 @@ +@@ -2,41 +2,17 @@ f: 2 errors in empty disjunction: f.name: conflicting values "int" and "str": ./in.cue:5:8 @@ -522,9 +594,61 @@ diff old new ./in.cue:9:8 - ./in.cue:15:4 ./in.cue:15:27 +-issue3606.data: 2 errors in empty disjunction: +-issue3606.data: conflicting values string and {notAllowed:true} (mismatched types string and struct): +- ./dependencies.cue:2:8 +- ./dependencies.cue:6:6 +-issue3606.data.notAllowed: field not allowed: +- ./dependencies.cue:3:3 +- ./dependencies.cue:4:6 +- ./dependencies.cue:6:15 Result: -@@ -37,19 +35,12 @@ + (_|_){ + // [eval] +- issue3606: (_|_){ +- // [eval] +- data: (_|_){ +- // [eval] issue3606.data: 2 errors in empty disjunction: +- // issue3606.data: conflicting values string and {notAllowed:true} (mismatched types string and struct): +- // ./dependencies.cue:2:8 +- // ./dependencies.cue:6:6 +- // issue3606.data.notAllowed: field not allowed: +- // ./dependencies.cue:3:3 +- // ./dependencies.cue:4:6 +- // ./dependencies.cue:6:15 +- notAllowed: (_|_){ +- // [eval] issue3606.data.notAllowed: field not allowed: +- // ./dependencies.cue:3:3 +- // ./dependencies.cue:4:6 +- // ./dependencies.cue:6:15 +- } ++ issue3606: (struct){ ++ data: (#struct){ ++ notAllowed: (bool){ true } + } + #S: ((string|struct)){ |((string){ string }, (#struct){ + }) } +@@ -71,9 +47,15 @@ + } + v: (#struct){ + x: (#list){ +- 0: (#struct){ +- y: (bool){ true } +- } ++ 0: (#struct){ |((#struct){ ++ y: (bool){ true } ++ }, (#struct){ ++ y: (bool){ true } ++ a: (string){ "append" } ++ }, (#struct){ ++ y: (bool){ true } ++ b: (string){ "prepend" } ++ }) } + } + } + } +@@ -102,19 +84,12 @@ // [eval] f: 2 errors in empty disjunction: // f.name: conflicting values "int" and "str": // ./in.cue:5:8 @@ -545,7 +669,7 @@ diff old new } e1: (struct){ a: ((null|struct)){ |((null){ null }, (struct){ -@@ -161,8 +152,8 @@ +@@ -226,8 +201,8 @@ e: (struct){ foobar: (#struct){ b: (#struct){ @@ -555,16 +679,18 @@ diff old new } } } -@@ -264,6 +255,9 @@ +@@ -329,7 +304,10 @@ let Ok#1 = (bool){ true } }, (#struct){ _ok: (bool){ true } +- let Ok#1multi = 〈0;_ok〉 + let Ok#1 = (bool){ true } + }, (#struct){ + _ok: (bool){ true } - let Ok#1multi = 〈0;_ok〉 ++ let Ok#1 = (bool){ true } x: (bool){ true } }) } + bar: (#struct){ |((#struct){ -- diff/todo/p1 -- issue3597.t1.foo: duplicate disjunct -- diff/todo/p3 -- @@ -583,10 +709,75 @@ f.val: conflicting values 3 and string (mismatched types int and string): ./in.cue:9:8 ./in.cue:15:4 ./in.cue:15:27 +issue3606.data: 2 errors in empty disjunction: +issue3606.data: conflicting values string and {notAllowed:true} (mismatched types string and struct): + ./dependencies.cue:2:8 + ./dependencies.cue:6:6 +issue3606.data.notAllowed: field not allowed: + ./dependencies.cue:3:3 + ./dependencies.cue:4:6 + ./dependencies.cue:6:15 Result: (_|_){ // [eval] + issue3606: (_|_){ + // [eval] + data: (_|_){ + // [eval] issue3606.data: 2 errors in empty disjunction: + // issue3606.data: conflicting values string and {notAllowed:true} (mismatched types string and struct): + // ./dependencies.cue:2:8 + // ./dependencies.cue:6:6 + // issue3606.data.notAllowed: field not allowed: + // ./dependencies.cue:3:3 + // ./dependencies.cue:4:6 + // ./dependencies.cue:6:15 + notAllowed: (_|_){ + // [eval] issue3606.data.notAllowed: field not allowed: + // ./dependencies.cue:3:3 + // ./dependencies.cue:4:6 + // ./dependencies.cue:6:15 + } + } + #S: ((string|struct)){ |((string){ string }, (#struct){ + }) } + } + issue3672: (struct){ + #A: ((string|struct)){ |((string){ string }, (#struct){ + y: (bool){ true } + }) } + #B: ((string|struct)){ |((string){ string }, (#struct){ + y: (bool){ true } + }, (#struct){ + a: (string){ "append" } + }, (#struct){ + b: (string){ "prepend" } + }) } + #fn: (#struct){ + #C: ((string|struct)){ |((string){ string }, (#struct){ + y: (bool){ true } + }, (#struct){ + a: (string){ "append" } + }, (#struct){ + b: (string){ "prepend" } + }) } + #out: (#struct){ + x: (list){ + } + } + } + #def: (#struct){ + x: (list){ + } + } + v: (#struct){ + x: (#list){ + 0: (#struct){ + y: (bool){ true } + } + } + } + } a: (int){ |(*(int){ 1 }, (int){ int }) } aa: (int){ |(*(int){ 1 }, *(int){ 2 }, (int){ int }) } b: (struct){ |((struct){ @@ -873,6 +1064,42 @@ Result: } } -- out/compile -- +--- dependencies.cue +{ + issue3606: { + data: ({ + notAllowed: true + } & 〈0;#S〉) + #S: (string|{}) + } + issue3672: { + #A: (string|{ + y: true + }) + #B: (〈0;#A〉|{ + a: "append" + }|{ + b: "prepend" + }) + #fn: { + #C: 〈1;#B〉 + #out: { + x: [ + ...〈2;#C〉, + ] + } + } + #def: (〈0;#fn〉 & {}).#out + v: 〈0;#def〉 + v: { + x: [ + { + y: true + }, + ] + } + } +} --- in.cue { a: (*1|int) diff --git a/internal/core/adt/eval_test.go b/internal/core/adt/eval_test.go index 35a38dbc008..d76d5f5f59c 100644 --- a/internal/core/adt/eval_test.go +++ b/internal/core/adt/eval_test.go @@ -101,7 +101,7 @@ func TestEvalAlpha(t *testing.T) { // externalDeps to agitate pending dependencies is replaced with a // dedicated mechanism. // - adt.DebugDeps = true // check unmatched dependencies. + // adt.DebugDeps = true // check unmatched dependencies. flags := cuedebug.Config{ Sharing: true, @@ -182,7 +182,7 @@ func runEvalTest(t *cuetxtar.Test, version internal.EvaluatorVersion, flags cued name := t.T.Name()[len("TestEvalAlpha/"):] expectErrs := skipDebugDepErrors[name] - if len(m) != expectErrs { + if adt.DebugDeps && len(m) != expectErrs { if expectErrs == 0 { t.Errorf("unexpected node errors: %d", len(m)) } else {