#name: Issue #23
#evalFull
-- in.cue --
x: {a:     1} | {a: 2}
y: x & {a: 3}
-- out/def --
x: {
	a: 1
} | {
	a: 2
}
y: _|_ // ; empty disjunction: conflicting values 2 and 3
-- out/legacy-debug --
<0>{x: (<1>{a: 1} | <2>{a: 2}), y: _|_((1 & 3):empty disjunction: conflicting values 1 and 3;(2 & 3):empty disjunction: conflicting values 2 and 3)}
-- out/compile --
--- in.cue
{
  x: ({
    a: 1
  }|{
    a: 2
  })
  y: (〈0;x〉 & {
    a: 3
  })
}
-- out/eval/stats --
Leaks:  0
Freed:  11
Reused: 6
Allocs: 5
Retain: 0

Unifications: 7
Conjuncts:    15
Disjuncts:    11
-- out/evalalpha --
Errors:
y: 2 errors in empty disjunction:
y.a: conflicting values 1 and 3:
    ./in.cue:1:12
    ./in.cue:2:12
y.a: conflicting values 2 and 3:
    ./in.cue:1:21
    ./in.cue:2:12

Result:
(_|_){
  // [eval]
  x: (struct){ |((struct){
      a: (int){ 1 }
    }, (struct){
      a: (int){ 2 }
    }) }
  y: (_|_){
    // [eval] y: 2 errors in empty disjunction:
    // y.a: conflicting values 1 and 3:
    //     ./in.cue:1:12
    //     ./in.cue:2:12
    // y.a: conflicting values 2 and 3:
    //     ./in.cue:1:21
    //     ./in.cue:2:12
    a: (int){ 3 }
  }
}
-- diff/-out/evalalpha<==>+out/eval --
diff old new
--- old
+++ new
@@ -2,11 +2,9 @@
 y: 2 errors in empty disjunction:
 y.a: conflicting values 1 and 3:
     ./in.cue:1:12
-    ./in.cue:2:4
     ./in.cue:2:12
 y.a: conflicting values 2 and 3:
     ./in.cue:1:21
-    ./in.cue:2:4
     ./in.cue:2:12
 
 Result:
@@ -21,17 +19,10 @@
     // [eval] y: 2 errors in empty disjunction:
     // y.a: conflicting values 1 and 3:
     //     ./in.cue:1:12
-    //     ./in.cue:2:4
     //     ./in.cue:2:12
     // y.a: conflicting values 2 and 3:
     //     ./in.cue:1:21
-    //     ./in.cue:2:4
-    //     ./in.cue:2:12
-    a: (_|_){
-      // [eval] y.a: conflicting values 2 and 3:
-      //     ./in.cue:1:21
-      //     ./in.cue:2:4
-      //     ./in.cue:2:12
-    }
+    //     ./in.cue:2:12
+    a: (int){ 3 }
   }
 }
-- diff/todo/p3 --
Missing error positions.
-- diff/explanation --
It is okay to show field a as long as the error is clear and points to the
violating disjunction.
-- out/eval --
Errors:
y: 2 errors in empty disjunction:
y.a: conflicting values 1 and 3:
    ./in.cue:1:12
    ./in.cue:2:4
    ./in.cue:2:12
y.a: conflicting values 2 and 3:
    ./in.cue:1:21
    ./in.cue:2:4
    ./in.cue:2:12

Result:
(_|_){
  // [eval]
  x: (struct){ |((struct){
      a: (int){ 1 }
    }, (struct){
      a: (int){ 2 }
    }) }
  y: (_|_){
    // [eval] y: 2 errors in empty disjunction:
    // y.a: conflicting values 1 and 3:
    //     ./in.cue:1:12
    //     ./in.cue:2:4
    //     ./in.cue:2:12
    // y.a: conflicting values 2 and 3:
    //     ./in.cue:1:21
    //     ./in.cue:2:4
    //     ./in.cue:2:12
    a: (_|_){
      // [eval] y.a: conflicting values 2 and 3:
      //     ./in.cue:1:21
      //     ./in.cue:2:4
      //     ./in.cue:2:12
    }
  }
}
