| # DO NOT EDIT; generated by go run testdata/gen.go |
| # |
| #name: obj unify |
| #evalPartial |
| -- in.cue -- |
| o1: {a: 1} & {b: 2} // {a:1,b:2} |
| o2: {a: 1, b: 2} & {b: 2} // {a:1,b:2} |
| o3: {a: 1} & {a: 1, b: 2} // {a:1,b:2} |
| o4: {a: 1} & {b: 2} // {a:1,b:2} |
| o4: {a: 1, b: 2} & {b: 2} |
| o4: {a: 1} & {a: 1, b: 2} |
| e: 1 // 1 & {a:3} |
| e: {a: 3} |
| -- out/def -- |
| o1: { |
| a: 1 |
| b: 2 |
| } |
| o2: { |
| a: 1 |
| b: 2 |
| } |
| o3: { |
| a: 1 |
| b: 2 |
| } |
| o4: { |
| a: 1 |
| b: 2 |
| } |
| e: _|_ // conflicting values 1 and {a: 3} (mismatched types int and struct) |
| -- out/legacy-debug -- |
| <0>{o1: <1>{a: 1, b: 2}, o2: <2>{a: 1, b: 2}, o3: <3>{a: 1, b: 2}, o4: <4>{a: 1, b: 2}, e: _|_((1 & <5>{a: 3}):conflicting values 1 and {a: 3} (mismatched types int and struct))} |
| -- out/compile -- |
| --- in.cue |
| { |
| o1: ({ |
| a: 1 |
| } & { |
| b: 2 |
| }) |
| o2: ({ |
| a: 1 |
| b: 2 |
| } & { |
| b: 2 |
| }) |
| o3: ({ |
| a: 1 |
| } & { |
| a: 1 |
| b: 2 |
| }) |
| o4: ({ |
| a: 1 |
| } & { |
| b: 2 |
| }) |
| o4: ({ |
| a: 1 |
| b: 2 |
| } & { |
| b: 2 |
| }) |
| o4: ({ |
| a: 1 |
| } & { |
| a: 1 |
| b: 2 |
| }) |
| e: 1 |
| e: { |
| a: 3 |
| } |
| } |
| -- out/eval -- |
| Errors: |
| e: conflicting values 1 and {a:3} (mismatched types int and struct): |
| ./in.cue:7:5 |
| ./in.cue:8:4 |
| |
| Result: |
| (_|_){ |
| // [eval] |
| o1: (struct){ |
| a: (int){ 1 } |
| b: (int){ 2 } |
| } |
| o2: (struct){ |
| a: (int){ 1 } |
| b: (int){ 2 } |
| } |
| o3: (struct){ |
| a: (int){ 1 } |
| b: (int){ 2 } |
| } |
| o4: (struct){ |
| a: (int){ 1 } |
| b: (int){ 2 } |
| } |
| e: (_|_){ |
| // [eval] e: conflicting values 1 and {a:3} (mismatched types int and struct): |
| // ./in.cue:7:5 |
| // ./in.cue:8:4 |
| a: (int){ 3 } |
| } |
| } |