cuelang.org/go@v0.13.0/cue/testdata/fulleval/002_resolve_all_disjunctions.txtar (about) 1 #name: resolve all disjunctions 2 #evalFull 3 -- in.cue -- 4 service: [Name=string]: { 5 name: string | *Name 6 port: int | *7080 7 } 8 service: foo: _ 9 service: bar: {port: 8000} 10 service: baz: {name: "foobar"} 11 -- out/def -- 12 service: { 13 {[Name=string]: { 14 name: string | *Name, port: int | *7080 15 }} 16 foo: { 17 name: string | *"foo" 18 port: int | *7080 19 } 20 bar: { 21 name: string | *"bar" 22 port: 8000 23 } 24 baz: { 25 name: "foobar" 26 port: int | *7080 27 } 28 } 29 -- out/export -- 30 service: { 31 foo: { 32 name: "foo" 33 port: 7080 34 } 35 bar: { 36 name: "bar" 37 port: 8000 38 } 39 baz: { 40 name: "foobar" 41 port: 7080 42 } 43 } 44 -- out/yaml -- 45 service: 46 foo: 47 name: foo 48 port: 7080 49 bar: 50 name: bar 51 port: 8000 52 baz: 53 name: foobar 54 port: 7080 55 -- out/json -- 56 {"service":{"foo":{"name":"foo","port":7080},"bar":{"name":"bar","port":8000},"baz":{"name":"foobar","port":7080}}} 57 -- out/legacy-debug -- 58 <0>{service: <1>{[]: <2>(Name: string)-><3>{name: (string | *<2>.Name), port: (int | *7080)}, foo: <4>{name: "foo", port: 7080}, bar: <5>{name: "bar", port: 8000}, baz: <6>{name: "foobar", port: 7080}}} 59 -- out/compile -- 60 --- in.cue 61 { 62 service: { 63 [string]: { 64 name: (string|*〈1;-〉) 65 port: (int|*7080) 66 } 67 } 68 service: { 69 foo: _ 70 } 71 service: { 72 bar: { 73 port: 8000 74 } 75 } 76 service: { 77 baz: { 78 name: "foobar" 79 } 80 } 81 } 82 -- out/eval/stats -- 83 Leaks: 0 84 Freed: 23 85 Reused: 17 86 Allocs: 6 87 Retain: 0 88 89 Unifications: 11 90 Conjuncts: 31 91 Disjuncts: 23 92 -- out/eval -- 93 (struct){ 94 service: (struct){ 95 foo: (struct){ 96 name: (string){ |(*(string){ "foo" }, (string){ string }) } 97 port: (int){ |(*(int){ 7080 }, (int){ int }) } 98 } 99 bar: (struct){ 100 port: (int){ 8000 } 101 name: (string){ |(*(string){ "bar" }, (string){ string }) } 102 } 103 baz: (struct){ 104 name: (string){ "foobar" } 105 port: (int){ |(*(int){ 7080 }, (int){ int }) } 106 } 107 } 108 }