internal/core/eval: add more positions to conflict errors

This should bring conflict errors mostly up to par with v0.2.2.

It also adds some context errors for definitions. More refined
tracing of references (in acceptor.Canopy) will be able to
address Issue #129.

Change-Id: Ic359a324c2d3034b4895b06cb7f91c3c546a8a0a
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/7302
Reviewed-by: CUE cueckoo <cueckoo@gmail.com>
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
diff --git a/internal/core/validate/validate_test.go b/internal/core/validate/validate_test.go
index a47afbd..496ad3b 100644
--- a/internal/core/validate/validate_test.go
+++ b/internal/core/validate/validate_test.go
@@ -65,20 +65,20 @@
 		in: `
 		1 & 2
 		`,
-		out: "eval\nincompatible values 2 and 1",
+		out: "eval\nconflicting values 2 and 1:\n    test:2:3\n    test:2:7",
 	}, {
 		desc: "evaluation error in field",
 		in: `
 		x: 1 & 2
 		`,
-		out: "eval\nx: incompatible values 2 and 1",
+		out: "eval\nx: conflicting values 2 and 1:\n    test:2:6\n    test:2:10",
 	}, {
 		desc: "first error",
 		in: `
 		x: 1 & 2
 		y: 2 & 4
 		`,
-		out: "eval\nx: incompatible values 2 and 1",
+		out: "eval\nx: conflicting values 2 and 1:\n    test:2:6\n    test:2:10",
 	}, {
 		desc: "all errors",
 		cfg:  &Config{AllErrors: true},
@@ -87,8 +87,12 @@
 		y: 2 & 4
 		`,
 		out: `eval
-x: incompatible values 2 and 1
-y: incompatible values 4 and 2`,
+x: conflicting values 2 and 1:
+    test:2:6
+    test:2:10
+y: conflicting values 4 and 2:
+    test:3:6
+    test:3:10`,
 	}, {
 		desc: "incomplete",
 		cfg:  &Config{Concrete: true},
@@ -142,7 +146,7 @@
 		y: string
 		x: 1 & 2
 		`,
-		out: "eval\nx: incompatible values 2 and 1",
+		out: "eval\nx: conflicting values 2 and 1:\n    test:3:6\n    test:3:10",
 	}, {
 		desc: "consider defaults for concreteness",
 		cfg:  &Config{Concrete: true},