github.com/solo-io/cue@v0.4.7/cue/testdata/benchmarks/dedupelem.txtar (about) 1 -- in.cue -- 2 package lpcorpus 3 4 #Value: {type: "int"} | {type: "float"} | {type: "string"} 5 6 foo: [{type: "float"}] & [...#Value] 7 foo: [{type: "float"}] & [...#Value] 8 foo: [{type: "float"}] & [...#Value] 9 foo: [{type: "float"}] & [...#Value] 10 foo: [{type: "float"}] & [...#Value] 11 foo: [{type: "string"}] & [...#Value] 12 foo: [{type: "string"}] & [...#Value] 13 foo: [{type: "string"}] & [...#Value] 14 foo: [{type: "float"}] & [...#Value] 15 foo: [{type: "float"}] & [...#Value] 16 -- out/eval -- 17 Errors: 18 foo.0: 2 errors in empty disjunction: 19 foo.0.type: conflicting values "int" and "float": 20 ./in.cue:3:16 21 ./in.cue:5:14 22 ./in.cue:5:30 23 foo.0.type: conflicting values "string" and "float": 24 ./in.cue:5:14 25 ./in.cue:10:14 26 27 Result: 28 (_|_){ 29 // [eval] 30 #Value: (#struct){ |((#struct){ 31 type: (string){ "int" } 32 }, (#struct){ 33 type: (string){ "float" } 34 }, (#struct){ 35 type: (string){ "string" } 36 }) } 37 foo: (_|_){ 38 // [eval] 39 0: (_|_){ 40 // [eval] foo.0: 2 errors in empty disjunction: 41 // foo.0.type: conflicting values "int" and "float": 42 // ./in.cue:3:16 43 // ./in.cue:5:14 44 // ./in.cue:5:30 45 // foo.0.type: conflicting values "string" and "float": 46 // ./in.cue:5:14 47 // ./in.cue:10:14 48 type: (_|_){ 49 // [eval] foo.0.type: conflicting values "string" and "float": 50 // ./in.cue:5:14 51 // ./in.cue:10:14 52 } 53 } 54 } 55 } 56 -- out/compile -- 57 --- in.cue 58 { 59 #Value: ({ 60 type: "int" 61 }|{ 62 type: "float" 63 }|{ 64 type: "string" 65 }) 66 foo: ([ 67 { 68 type: "float" 69 }, 70 ] & [ 71 ...〈0;#Value〉, 72 ]) 73 foo: ([ 74 { 75 type: "float" 76 }, 77 ] & [ 78 ...〈0;#Value〉, 79 ]) 80 foo: ([ 81 { 82 type: "float" 83 }, 84 ] & [ 85 ...〈0;#Value〉, 86 ]) 87 foo: ([ 88 { 89 type: "float" 90 }, 91 ] & [ 92 ...〈0;#Value〉, 93 ]) 94 foo: ([ 95 { 96 type: "float" 97 }, 98 ] & [ 99 ...〈0;#Value〉, 100 ]) 101 foo: ([ 102 { 103 type: "string" 104 }, 105 ] & [ 106 ...〈0;#Value〉, 107 ]) 108 foo: ([ 109 { 110 type: "string" 111 }, 112 ] & [ 113 ...〈0;#Value〉, 114 ]) 115 foo: ([ 116 { 117 type: "string" 118 }, 119 ] & [ 120 ...〈0;#Value〉, 121 ]) 122 foo: ([ 123 { 124 type: "float" 125 }, 126 ] & [ 127 ...〈0;#Value〉, 128 ]) 129 foo: ([ 130 { 131 type: "float" 132 }, 133 ] & [ 134 ...〈0;#Value〉, 135 ]) 136 }