internal/core/adt: add path location for majority of errors
Change-Id: I8a7b19851af88ecd09ae9032d659ade3570b73e3
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/6650
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
diff --git a/cue/testdata/basicrewrite/001_regexp.txtar b/cue/testdata/basicrewrite/001_regexp.txtar
index 99b3e0f..489ed68 100644
--- a/cue/testdata/basicrewrite/001_regexp.txtar
+++ b/cue/testdata/basicrewrite/001_regexp.txtar
@@ -62,11 +62,12 @@
}
-- out/eval --
Errors:
-invalid value "foo" (out of bound =~"[a-z]{4}")
-invalid value <5 (mismatched types number and string)
-cannot use 1 (type int) as type (string|bytes):
+e3: invalid value <5 (mismatched types number and string)
+b3: invalid value "foo" (out of bound =~"[a-z]{4}"):
+ ./in.cue:10:5
+e1: cannot use 1 (type int) as type (string|bytes):
./in.cue:18:5
-cannot use true (type bool) as type (string|bytes):
+e2: cannot use true (type bool) as type (string|bytes):
./in.cue:19:5
Result:
@@ -79,20 +80,21 @@
b1: (string){ "a" }
b2: (string){ "foo" }
b3: (_|_){
- // [eval] invalid value "foo" (out of bound =~"[a-z]{4}")
+ // [eval] b3: invalid value "foo" (out of bound =~"[a-z]{4}"):
+ // ./in.cue:10:5
}
b4: (string){ "foo" }
s1: (string){ &(!="b", =~"c") }
s2: (string){ &(!="b", =~"[a-z]") }
e1: (_|_){
- // [eval] cannot use 1 (type int) as type (string|bytes):
+ // [eval] e1: cannot use 1 (type int) as type (string|bytes):
// ./in.cue:18:5
}
e2: (_|_){
- // [eval] cannot use true (type bool) as type (string|bytes):
+ // [eval] e2: cannot use true (type bool) as type (string|bytes):
// ./in.cue:19:5
}
e3: (_|_){
- // [eval] invalid value <5 (mismatched types number and string)
+ // [eval] e3: invalid value <5 (mismatched types number and string)
}
}
diff --git a/cue/testdata/basicrewrite/002_arithmetic.txtar b/cue/testdata/basicrewrite/002_arithmetic.txtar
index b2f1914..21d4cfb 100644
--- a/cue/testdata/basicrewrite/002_arithmetic.txtar
+++ b/cue/testdata/basicrewrite/002_arithmetic.txtar
@@ -95,27 +95,27 @@
}
-- out/eval --
Errors:
-failed arithmetic: division by zero:
+divZero: failed arithmetic: division by zero:
./in.cue:8:10
-failed arithmetic: division undefined:
+div00: failed arithmetic: division undefined:
./in.cue:9:10
-division by zero:
+idiv00: division by zero:
./in.cue:13:9
-division by zero:
+imod00: division by zero:
./in.cue:14:9
-division by zero:
+iquo00: division by zero:
./in.cue:15:9
-division by zero:
+irem00: division by zero:
./in.cue:16:9
-invalid operands 2 and "a" to '+' (type int and string):
+e0: invalid operands 2 and "a" to '+' (type int and string):
./in.cue:23:5
-invalid operands 1.0 and 2 to 'div' (type float and int):
+e5: invalid operands 1.0 and 2 to 'div' (type float and int):
./in.cue:29:5
-invalid operands 2 and 2.0 to 'rem' (type int and float):
+e6: invalid operands 2 and 2.0 to 'rem' (type int and float):
./in.cue:30:5
-invalid operands 2 and 2.0 to 'quo' (type int and float):
+e7: invalid operands 2 and 2.0 to 'quo' (type int and float):
./in.cue:31:5
-invalid operands 1.0 and 1 to 'mod' (type float and int):
+e8: invalid operands 1.0 and 1 to 'mod' (type float and int):
./in.cue:32:5
Result:
@@ -128,29 +128,29 @@
div2: (float){ 4.00000000000000000000000 }
div3: (float){ 1 }
divZero: (_|_){
- // [eval] failed arithmetic: division by zero:
+ // [eval] divZero: failed arithmetic: division by zero:
// ./in.cue:8:10
}
div00: (_|_){
- // [eval] failed arithmetic: division undefined:
+ // [eval] div00: failed arithmetic: division undefined:
// ./in.cue:9:10
}
b: (bool){ true }
add: (float){ 5.00000000000000000000000 }
idiv00: (_|_){
- // [eval] division by zero:
+ // [eval] idiv00: division by zero:
// ./in.cue:13:9
}
imod00: (_|_){
- // [eval] division by zero:
+ // [eval] imod00: division by zero:
// ./in.cue:14:9
}
iquo00: (_|_){
- // [eval] division by zero:
+ // [eval] iquo00: division by zero:
// ./in.cue:15:9
}
irem00: (_|_){
- // [eval] division by zero:
+ // [eval] irem00: division by zero:
// ./in.cue:16:9
}
v1: (float){ 5.0000000000E+11 }
@@ -158,23 +158,23 @@
v3: (float){ 0.666666666666666666666667 }
v5: (int){ 0 }
e0: (_|_){
- // [eval] invalid operands 2 and "a" to '+' (type int and string):
+ // [eval] e0: invalid operands 2 and "a" to '+' (type int and string):
// ./in.cue:23:5
}
e5: (_|_){
- // [eval] invalid operands 1.0 and 2 to 'div' (type float and int):
+ // [eval] e5: invalid operands 1.0 and 2 to 'div' (type float and int):
// ./in.cue:29:5
}
e6: (_|_){
- // [eval] invalid operands 2 and 2.0 to 'rem' (type int and float):
+ // [eval] e6: invalid operands 2 and 2.0 to 'rem' (type int and float):
// ./in.cue:30:5
}
e7: (_|_){
- // [eval] invalid operands 2 and 2.0 to 'quo' (type int and float):
+ // [eval] e7: invalid operands 2 and 2.0 to 'quo' (type int and float):
// ./in.cue:31:5
}
e8: (_|_){
- // [eval] invalid operands 1.0 and 1 to 'mod' (type float and int):
+ // [eval] e8: invalid operands 1.0 and 1 to 'mod' (type float and int):
// ./in.cue:32:5
}
}
diff --git a/cue/testdata/basicrewrite/003_integer-specific_arithmetic.txtar b/cue/testdata/basicrewrite/003_integer-specific_arithmetic.txtar
index f5f5245..742b92a 100644
--- a/cue/testdata/basicrewrite/003_integer-specific_arithmetic.txtar
+++ b/cue/testdata/basicrewrite/003_integer-specific_arithmetic.txtar
@@ -87,21 +87,21 @@
}
-- out/eval --
Errors:
-invalid operands 2.0 and 1 to 'quo' (type float and int):
+qe1: invalid operands 2.0 and 1 to 'quo' (type float and int):
./in.cue:5:6
-invalid operands 2 and 1.0 to 'quo' (type int and float):
+qe2: invalid operands 2 and 1.0 to 'quo' (type int and float):
./in.cue:6:6
-invalid operands 2.0 and 1 to 'rem' (type float and int):
+re1: invalid operands 2.0 and 1 to 'rem' (type float and int):
./in.cue:12:6
-invalid operands 2 and 1.0 to 'rem' (type int and float):
+re2: invalid operands 2 and 1.0 to 'rem' (type int and float):
./in.cue:13:6
-invalid operands 2.0 and 1 to 'div' (type float and int):
+de1: invalid operands 2.0 and 1 to 'div' (type float and int):
./in.cue:19:6
-invalid operands 2 and 1.0 to 'div' (type int and float):
+de2: invalid operands 2 and 1.0 to 'div' (type int and float):
./in.cue:20:6
-invalid operands 2.0 and 1 to 'mod' (type float and int):
+me1: invalid operands 2.0 and 1 to 'mod' (type float and int):
./in.cue:26:6
-invalid operands 2 and 1.0 to 'mod' (type int and float):
+me2: invalid operands 2 and 1.0 to 'mod' (type int and float):
./in.cue:27:6
Result:
@@ -112,11 +112,11 @@
q3: (int){ -2 }
q4: (int){ 2 }
qe1: (_|_){
- // [eval] invalid operands 2.0 and 1 to 'quo' (type float and int):
+ // [eval] qe1: invalid operands 2.0 and 1 to 'quo' (type float and int):
// ./in.cue:5:6
}
qe2: (_|_){
- // [eval] invalid operands 2 and 1.0 to 'quo' (type int and float):
+ // [eval] qe2: invalid operands 2 and 1.0 to 'quo' (type int and float):
// ./in.cue:6:6
}
r1: (int){ 1 }
@@ -124,11 +124,11 @@
r3: (int){ -1 }
r4: (int){ -1 }
re1: (_|_){
- // [eval] invalid operands 2.0 and 1 to 'rem' (type float and int):
+ // [eval] re1: invalid operands 2.0 and 1 to 'rem' (type float and int):
// ./in.cue:12:6
}
re2: (_|_){
- // [eval] invalid operands 2 and 1.0 to 'rem' (type int and float):
+ // [eval] re2: invalid operands 2 and 1.0 to 'rem' (type int and float):
// ./in.cue:13:6
}
d1: (int){ 2 }
@@ -136,11 +136,11 @@
d3: (int){ -3 }
d4: (int){ 3 }
de1: (_|_){
- // [eval] invalid operands 2.0 and 1 to 'div' (type float and int):
+ // [eval] de1: invalid operands 2.0 and 1 to 'div' (type float and int):
// ./in.cue:19:6
}
de2: (_|_){
- // [eval] invalid operands 2 and 1.0 to 'div' (type int and float):
+ // [eval] de2: invalid operands 2 and 1.0 to 'div' (type int and float):
// ./in.cue:20:6
}
m1: (int){ 1 }
@@ -148,11 +148,11 @@
m3: (int){ 1 }
m4: (int){ 1 }
me1: (_|_){
- // [eval] invalid operands 2.0 and 1 to 'mod' (type float and int):
+ // [eval] me1: invalid operands 2.0 and 1 to 'mod' (type float and int):
// ./in.cue:26:6
}
me2: (_|_){
- // [eval] invalid operands 2 and 1.0 to 'mod' (type int and float):
+ // [eval] me2: invalid operands 2 and 1.0 to 'mod' (type int and float):
// ./in.cue:27:6
}
}
diff --git a/cue/testdata/basicrewrite/004_booleans.txtar b/cue/testdata/basicrewrite/004_booleans.txtar
index 3fcd416..c27259b 100644
--- a/cue/testdata/basicrewrite/004_booleans.txtar
+++ b/cue/testdata/basicrewrite/004_booleans.txtar
@@ -27,7 +27,7 @@
}
-- out/eval --
Errors:
-incompatible values false and true
+e: incompatible values false and true
Result:
(_|_){
@@ -35,6 +35,6 @@
t: (bool){ true }
f: (bool){ false }
e: (_|_){
- // [eval] incompatible values false and true
+ // [eval] e: incompatible values false and true
}
}
diff --git a/cue/testdata/basicrewrite/005_boolean_arithmetic.txtar b/cue/testdata/basicrewrite/005_boolean_arithmetic.txtar
index 51ec726..c96c492 100644
--- a/cue/testdata/basicrewrite/005_boolean_arithmetic.txtar
+++ b/cue/testdata/basicrewrite/005_boolean_arithmetic.txtar
@@ -30,7 +30,7 @@
}
-- out/eval --
Errors:
-incompatible values false and true
+f: incompatible values false and true
Result:
(_|_){
@@ -41,6 +41,6 @@
d: (bool){ true }
e: (bool){ true }
f: (_|_){
- // [eval] incompatible values false and true
+ // [eval] f: incompatible values false and true
}
}
diff --git a/cue/testdata/basicrewrite/006_basic_type.txtar b/cue/testdata/basicrewrite/006_basic_type.txtar
index d352f6c..ed33d28 100644
--- a/cue/testdata/basicrewrite/006_basic_type.txtar
+++ b/cue/testdata/basicrewrite/006_basic_type.txtar
@@ -34,7 +34,7 @@
}
-- out/eval --
Errors:
-invalid value float (mismatched types float and int)
+d: invalid value float (mismatched types float and int)
Result:
(_|_){
@@ -43,7 +43,7 @@
b: (int){ 1 }
c: (float){ 1.0 }
d: (_|_){
- // [eval] invalid value float (mismatched types float and int)
+ // [eval] d: invalid value float (mismatched types float and int)
}
e: (string){ "4" }
f: (bool){ true }
diff --git a/cue/testdata/basicrewrite/007_strings_and_bytes.txtar b/cue/testdata/basicrewrite/007_strings_and_bytes.txtar
index c416314..27383f7 100644
--- a/cue/testdata/basicrewrite/007_strings_and_bytes.txtar
+++ b/cue/testdata/basicrewrite/007_strings_and_bytes.txtar
@@ -41,9 +41,9 @@
}
-- out/eval --
Errors:
-invalid operands "a" and '' to '+' (type string and bytes):
+e0: invalid operands "a" and '' to '+' (type string and bytes):
./in.cue:10:5
-invalid operands 'b' and "c" to '+' (type bytes and string):
+e1: invalid operands 'b' and "c" to '+' (type bytes and string):
./in.cue:11:5
Result:
@@ -56,11 +56,11 @@
b1: (bytes){ 'abcabcabc' }
b2: (bytes){ 'abcabc' }
e0: (_|_){
- // [eval] invalid operands "a" and '' to '+' (type string and bytes):
+ // [eval] e0: invalid operands "a" and '' to '+' (type string and bytes):
// ./in.cue:10:5
}
e1: (_|_){
- // [eval] invalid operands 'b' and "c" to '+' (type bytes and string):
+ // [eval] e1: invalid operands 'b' and "c" to '+' (type bytes and string):
// ./in.cue:11:5
}
}
diff --git a/cue/testdata/basicrewrite/010_lists.txtar b/cue/testdata/basicrewrite/010_lists.txtar
index 9de56c6..4f777fd 100644
--- a/cue/testdata/basicrewrite/010_lists.txtar
+++ b/cue/testdata/basicrewrite/010_lists.txtar
@@ -76,12 +76,15 @@
}
-- out/eval --
Errors:
-conflicting types
-invalid value 8 (out of bound <=5)
-invalid list index d (type string):
+e: conflicting types list and int
+e2: invalid list index d (type string):
./in.cue:5:12
-invalid negative index -1:
+e3: invalid negative index -1:
./in.cue:6:8
+e4.3: invalid value 8 (out of bound <=5):
+ ./in.cue:7:24
+e5.3: invalid value 8 (out of bound <=5):
+ ./in.cue:8:39
Result:
(_|_){
@@ -98,14 +101,14 @@
2: (int){ 3 }
}
e: (_|_){
- // [eval] conflicting types
+ // [eval] e: conflicting types list and int
}
e2: (_|_){
- // [eval] invalid list index d (type string):
+ // [eval] e2: invalid list index d (type string):
// ./in.cue:5:12
}
e3: (_|_){
- // [eval] invalid negative index -1:
+ // [eval] e3: invalid negative index -1:
// ./in.cue:6:8
}
e4: (_|_){
@@ -114,7 +117,8 @@
1: (int){ 2 }
2: (int){ 4 }
3: (_|_){
- // [eval] invalid value 8 (out of bound <=5)
+ // [eval] e4.3: invalid value 8 (out of bound <=5):
+ // ./in.cue:7:24
}
}
e5: (_|_){
@@ -123,7 +127,8 @@
1: (int){ 2 }
2: (int){ 4 }
3: (_|_){
- // [eval] invalid value 8 (out of bound <=5)
+ // [eval] e5.3: invalid value 8 (out of bound <=5):
+ // ./in.cue:8:39
}
}
}
diff --git a/cue/testdata/basicrewrite/011_list_arithmetic.txtar b/cue/testdata/basicrewrite/011_list_arithmetic.txtar
index 23636f1..cae99ed 100644
--- a/cue/testdata/basicrewrite/011_list_arithmetic.txtar
+++ b/cue/testdata/basicrewrite/011_list_arithmetic.txtar
@@ -47,7 +47,7 @@
}
-- out/eval --
Errors:
-cannot convert negative number to uint64:
+e: cannot convert negative number to uint64:
./in.cue:10:9
Result:
@@ -92,7 +92,7 @@
3: (int){ 1 }
}
e: (_|_){
- // [eval] cannot convert negative number to uint64:
+ // [eval] e: cannot convert negative number to uint64:
// ./in.cue:10:9
}
}
diff --git a/cue/testdata/basicrewrite/012_selecting.txtar b/cue/testdata/basicrewrite/012_selecting.txtar
index 59ca51e..dc81d1a 100644
--- a/cue/testdata/basicrewrite/012_selecting.txtar
+++ b/cue/testdata/basicrewrite/012_selecting.txtar
@@ -60,9 +60,9 @@
}
-- out/eval --
Errors:
-invalid struct selector 4 (type int):
+e: invalid struct selector 4 (type int):
./in.cue:4:16
-invalid list index b (type string):
+h: invalid list index b (type string):
./in.cue:7:13
Result:
@@ -75,19 +75,19 @@
index: (int){ 2 }
mulidx: (int){ 3 }
e: (_|_){
- // [eval] invalid struct selector 4 (type int):
+ // [eval] e: invalid struct selector 4 (type int):
// ./in.cue:4:16
}
f: (_|_){
- // [incomplete] undefined field b:
+ // [incomplete] f: undefined field b:
// ./in.cue:5:16
}
g: (_|_){
- // [incomplete] undefined field b:
+ // [incomplete] g: undefined field b:
// ./in.cue:6:16
}
h: (_|_){
- // [eval] invalid list index b (type string):
+ // [eval] h: invalid list index b (type string):
// ./in.cue:7:13
}
}
diff --git a/cue/testdata/basicrewrite/013_obj_unify.txtar b/cue/testdata/basicrewrite/013_obj_unify.txtar
index ee5a69a..15eb6f7 100644
--- a/cue/testdata/basicrewrite/013_obj_unify.txtar
+++ b/cue/testdata/basicrewrite/013_obj_unify.txtar
@@ -75,7 +75,7 @@
}
-- out/eval --
Errors:
-conflicting values struct and int
+e: conflicting values struct and int
Result:
(_|_){
@@ -97,7 +97,7 @@
b: (int){ 2 }
}
e: (_|_){
- // [eval] conflicting values struct and int
+ // [eval] e: conflicting values struct and int
a: (int){ 3 }
}
}
diff --git a/cue/testdata/basicrewrite/015_types.txtar b/cue/testdata/basicrewrite/015_types.txtar
index ea817a0..c9b218b 100644
--- a/cue/testdata/basicrewrite/015_types.txtar
+++ b/cue/testdata/basicrewrite/015_types.txtar
@@ -39,12 +39,13 @@
}
-- out/eval --
Errors:
-invalid value string (mismatched types string and int)
-value can never become concrete:
+e: invalid value string (mismatched types string and int)
+e2: invalid value string (mismatched types string and int)
+b: value can never become concrete:
./in.cue:7:5
-invalid operation ++true (+ bool):
+p: invalid operation ++true (+ bool):
./in.cue:8:5
-invalid operation --false (- bool):
+m: invalid operation --false (- bool):
./in.cue:9:5
Result:
@@ -55,21 +56,21 @@
s: (string){ string }
t: (string){ "s" }
e: (_|_){
- // [eval] invalid value string (mismatched types string and int)
+ // [eval] e: invalid value string (mismatched types string and int)
}
e2: (_|_){
- // [eval] invalid value string (mismatched types string and int)
+ // [eval] e2: invalid value string (mismatched types string and int)
}
b: (_|_){
- // [eval] value can never become concrete:
+ // [eval] b: value can never become concrete:
// ./in.cue:7:5
}
p: (_|_){
- // [eval] invalid operation ++true (+ bool):
+ // [eval] p: invalid operation ++true (+ bool):
// ./in.cue:8:5
}
m: (_|_){
- // [eval] invalid operation --false (- bool):
+ // [eval] m: invalid operation --false (- bool):
// ./in.cue:9:5
}
}
diff --git a/cue/testdata/basicrewrite/016_comparison.txtar b/cue/testdata/basicrewrite/016_comparison.txtar
index 6e204b1..11ef3b3 100644
--- a/cue/testdata/basicrewrite/016_comparison.txtar
+++ b/cue/testdata/basicrewrite/016_comparison.txtar
@@ -38,7 +38,7 @@
}
-- out/eval --
Errors:
-invalid operands 2 and "s" to '==' (type int and string):
+err: invalid operands 2 and "s" to '==' (type int and string):
./in.cue:9:6
Result:
@@ -52,7 +52,7 @@
geq: (bool){ true }
seq: (bool){ true }
err: (_|_){
- // [eval] invalid operands 2 and "s" to '==' (type int and string):
+ // [eval] err: invalid operands 2 and "s" to '==' (type int and string):
// ./in.cue:9:6
}
}
diff --git a/cue/testdata/basicrewrite/017_null.txtar b/cue/testdata/basicrewrite/017_null.txtar
index e04c50a..9390a53 100644
--- a/cue/testdata/basicrewrite/017_null.txtar
+++ b/cue/testdata/basicrewrite/017_null.txtar
@@ -37,7 +37,7 @@
}
-- out/eval --
Errors:
-cannot call non-function null (type null):
+call: cannot call non-function null (type null):
./in.cue:9:7
Result:
@@ -50,7 +50,7 @@
eq2: (bool){ false }
ne1: (bool){ true }
call: (_|_){
- // [eval] cannot call non-function null (type null):
+ // [eval] call: cannot call non-function null (type null):
// ./in.cue:9:7
}
}
diff --git a/cue/testdata/compile/scope.txtar b/cue/testdata/compile/scope.txtar
index 42a032e..1b69449 100644
--- a/cue/testdata/compile/scope.txtar
+++ b/cue/testdata/compile/scope.txtar
@@ -76,7 +76,7 @@
}
-- out/eval --
Errors:
-structural cycle
+schema.next: structural cycle
Result:
(_|_){
@@ -103,7 +103,7 @@
schema: (_|_){
// [structural cycle]
next: (_|_){
- // [structural cycle] structural cycle
+ // [structural cycle] schema.next: structural cycle
next: (_|_){// 〈1;let _schema_1〉
}
}
diff --git a/cue/testdata/comprehensions/for.txtar b/cue/testdata/comprehensions/for.txtar
index 909b818..44e7836 100644
--- a/cue/testdata/comprehensions/for.txtar
+++ b/cue/testdata/comprehensions/for.txtar
@@ -9,7 +9,7 @@
e: int
-- out/eval --
Errors:
-invalid operand e (found int, want list or struct):
+k: invalid operand e (found int, want list or struct):
./in.cue:7:15
Result:
@@ -28,7 +28,7 @@
y: (struct){
}
k: (_|_){
- // [eval] invalid operand e (found int, want list or struct):
+ // [eval] k: invalid operand e (found int, want list or struct):
// ./in.cue:7:15
}
e: (int){ int }
diff --git a/cue/testdata/cycle/021_delayed_constraint_failure.txtar b/cue/testdata/cycle/021_delayed_constraint_failure.txtar
index 9fb2ce2..ca71e0f 100644
--- a/cue/testdata/cycle/021_delayed_constraint_failure.txtar
+++ b/cue/testdata/cycle/021_delayed_constraint_failure.txtar
@@ -26,17 +26,17 @@
}
-- out/eval --
Errors:
-incompatible values 101 and 100
-incompatible values 200 and 210
+b: incompatible values 200 and 210
+x: incompatible values 101 and 100
Result:
(_|_){
// [eval]
a: (int){ 100 }
b: (_|_){
- // [eval] incompatible values 200 and 210
+ // [eval] b: incompatible values 200 and 210
}
x: (_|_){
- // [eval] incompatible values 101 and 100
+ // [eval] x: incompatible values 101 and 100
}
}
diff --git a/cue/testdata/cycle/023_reentrance.txtar b/cue/testdata/cycle/023_reentrance.txtar
index 57913b6..b60f9eb 100644
--- a/cue/testdata/cycle/023_reentrance.txtar
+++ b/cue/testdata/cycle/023_reentrance.txtar
@@ -85,7 +85,7 @@
nn: (int){ int }
out: (_|_){
// [incomplete] incomplete
- // undefined field out:
+ // fibRec.out: undefined field out:
// ./in.cue:3:40
}
}
diff --git a/cue/testdata/cycle/025_cannot_resolve_references_that_would_be_ambiguous.txtar b/cue/testdata/cycle/025_cannot_resolve_references_that_would_be_ambiguous.txtar
index 412f416..885c159 100644
--- a/cue/testdata/cycle/025_cannot_resolve_references_that_would_be_ambiguous.txtar
+++ b/cue/testdata/cycle/025_cannot_resolve_references_that_would_be_ambiguous.txtar
@@ -56,10 +56,10 @@
-- out/eval --
(struct){
a1: (_|_){
- // [incomplete] incomplete cause disjunction
+ // [incomplete] a1: incomplete cause disjunction
}
a2: (_|_){
- // [incomplete] incomplete cause disjunction
+ // [incomplete] a2: incomplete cause disjunction
}
a3: (int){ 1 }
b1: (int){ |((int){ 0 }, (int){ 1 }) }
diff --git a/cue/testdata/cycle/049_self-reference_cycles_conflicts_with_strings.txtar b/cue/testdata/cycle/049_self-reference_cycles_conflicts_with_strings.txtar
index 8a13a29..42cb241 100644
--- a/cue/testdata/cycle/049_self-reference_cycles_conflicts_with_strings.txtar
+++ b/cue/testdata/cycle/049_self-reference_cycles_conflicts_with_strings.txtar
@@ -28,7 +28,7 @@
}
-- out/eval --
Errors:
-incompatible values "hey!?" and "hey"
+a.x: incompatible values "hey!?" and "hey"
Result:
(_|_){
@@ -36,10 +36,10 @@
a: (_|_){
// [eval]
x: (_|_){
- // [eval] incompatible values "hey!?" and "hey"
+ // [eval] a.x: incompatible values "hey!?" and "hey"
}
y: (_|_){
- // [eval] incompatible values "hey!?" and "hey"
+ // [eval] a.x: incompatible values "hey!?" and "hey"
}
}
}
diff --git a/cue/testdata/cycle/051_resolved_self-reference_cycles_with_disjunction.txtar b/cue/testdata/cycle/051_resolved_self-reference_cycles_with_disjunction.txtar
index e346530..ee95f65 100644
--- a/cue/testdata/cycle/051_resolved_self-reference_cycles_with_disjunction.txtar
+++ b/cue/testdata/cycle/051_resolved_self-reference_cycles_with_disjunction.txtar
@@ -159,7 +159,7 @@
}
-- out/eval --
Errors:
-incompatible values 7 and 6:
+xe3: incompatible values 7 and 6:
./in.cue:44:6
Result:
@@ -188,22 +188,22 @@
xd4: (int){ 9 }
xd5: (int){ 10 }
xe1: (_|_){
- // [incomplete] empty disjunction
+ // [incomplete] xe1: empty disjunction
}
xe2: (_|_){
- // [eval] incompatible values 7 and 6:
+ // [eval] xe3: incompatible values 7 and 6:
// ./in.cue:44:6
}
xe3: (_|_){
- // [eval] incompatible values 7 and 6:
+ // [eval] xe3: incompatible values 7 and 6:
// ./in.cue:44:6
}
xe4: (_|_){
- // [eval] incompatible values 7 and 6:
+ // [eval] xe3: incompatible values 7 and 6:
// ./in.cue:44:6
}
xe5: (_|_){
- // [eval] incompatible values 7 and 6:
+ // [eval] xe3: incompatible values 7 and 6:
// ./in.cue:44:6
}
xf1: (int){ |((int){ 8 }, (int){ 9 }) }
diff --git a/cue/testdata/cycle/052_resolved_self-reference_cycles_with_disjunction_with_defaults.txtar b/cue/testdata/cycle/052_resolved_self-reference_cycles_with_disjunction_with_defaults.txtar
index 6295a4f..de11972 100644
--- a/cue/testdata/cycle/052_resolved_self-reference_cycles_with_disjunction_with_defaults.txtar
+++ b/cue/testdata/cycle/052_resolved_self-reference_cycles_with_disjunction_with_defaults.txtar
@@ -129,7 +129,7 @@
}
-- out/eval --
Errors:
-incompatible values 7 and 6:
+xe3: incompatible values 7 and 6:
./in.cue:37:6
Result:
@@ -158,22 +158,22 @@
xd4: (int){ 9 }
xd5: (int){ 10 }
xe1: (_|_){
- // [incomplete] empty disjunction
+ // [incomplete] xe1: empty disjunction
}
xe2: (_|_){
- // [eval] incompatible values 7 and 6:
+ // [eval] xe3: incompatible values 7 and 6:
// ./in.cue:37:6
}
xe3: (_|_){
- // [eval] incompatible values 7 and 6:
+ // [eval] xe3: incompatible values 7 and 6:
// ./in.cue:37:6
}
xe4: (_|_){
- // [eval] incompatible values 7 and 6:
+ // [eval] xe3: incompatible values 7 and 6:
// ./in.cue:37:6
}
xe5: (_|_){
- // [eval] incompatible values 7 and 6:
+ // [eval] xe3: incompatible values 7 and 6:
// ./in.cue:37:6
}
z1: (int){ |(*(int){ 11 }, (int){ 13 }) }
diff --git a/cue/testdata/cycle/disjunction.txtar b/cue/testdata/cycle/disjunction.txtar
index accdcfe..b6e6af1 100644
--- a/cue/testdata/cycle/disjunction.txtar
+++ b/cue/testdata/cycle/disjunction.txtar
@@ -39,7 +39,7 @@
-- out/eval --
Errors:
-structural cycle
+cycle.a: structural cycle
Result:
(_|_){
@@ -47,7 +47,7 @@
cycle: (_|_){
// [structural cycle]
a: (_|_){
- // [structural cycle] structural cycle
+ // [structural cycle] cycle.a: structural cycle
a: (_|_){// 〈1;cycle〉
}
}
diff --git a/cue/testdata/cycle/issue241.txtar b/cue/testdata/cycle/issue241.txtar
index 833dab2..62f2574 100644
--- a/cue/testdata/cycle/issue241.txtar
+++ b/cue/testdata/cycle/issue241.txtar
@@ -28,10 +28,10 @@
(struct){
#Value: (int){ |((int){ 0 }, (int){ 1 }) }
foo: (_|_){
- // [incomplete] incomplete cause disjunction
+ // [incomplete] foo: incomplete cause disjunction
}
bar: (_|_){
- // [incomplete] incomplete cause disjunction
+ // [incomplete] bar: incomplete cause disjunction
}
Foo: (int){ 1 }
Bar: (int){ 0 }
diff --git a/cue/testdata/cycle/issue429.txtar b/cue/testdata/cycle/issue429.txtar
index 6e487d1..84a4484 100644
--- a/cue/testdata/cycle/issue429.txtar
+++ b/cue/testdata/cycle/issue429.txtar
@@ -52,8 +52,10 @@
-- out/eval --
Errors:
-invalid value 5 (out of bound <5)
-invalid value 5 (out of bound >10)
+es3.max: invalid value 5 (out of bound >10):
+ ./in.cue:5:10
+er3.min: invalid value 5 (out of bound <5):
+ ./in.cue:29:10
Result:
(_|_){
@@ -88,15 +90,16 @@
res: (int){ |(*(int){ 0 }, (int){ &(>=0, int) }) }
min: (int){ 10 }
max: (_|_){
- // [eval] invalid value 5 (out of bound >10)
+ // [eval] es3.max: invalid value 5 (out of bound >10):
+ // ./in.cue:5:10
}
}
#nonEmptyRange: (#struct){
min: (_|_){
- // [incomplete] incomplete cause disjunction
+ // [incomplete] #nonEmptyRange.min: incomplete cause disjunction
}
max: (_|_){
- // [incomplete] incomplete cause disjunction
+ // [incomplete] #nonEmptyRange.min: incomplete cause disjunction
}
}
r1: (#struct){
@@ -114,10 +117,12 @@
er3: (_|_){
// [eval]
min: (_|_){
- // [eval] invalid value 5 (out of bound <5)
+ // [eval] er3.min: invalid value 5 (out of bound <5):
+ // ./in.cue:29:10
}
max: (_|_){
- // [eval] invalid value 5 (out of bound <5)
+ // [eval] er3.min: invalid value 5 (out of bound <5):
+ // ./in.cue:29:10
}
}
}
diff --git a/cue/testdata/cycle/structural.txtar b/cue/testdata/cycle/structural.txtar
index 32b4d51..66e04ae 100644
--- a/cue/testdata/cycle/structural.txtar
+++ b/cue/testdata/cycle/structural.txtar
@@ -217,9 +217,37 @@
-- out/eval --
Errors:
-conflicting types
-conflicting types list and struct
-structural cycle
+a1.f.0: structural cycle
+a3.f.g: structural cycle
+b4.x.y.0: structural cycle
+b6.b.a.0: conflicting types list and int
+b6.b.a.0.0: structural cycle
+b6.x.a.0: structural cycle
+b7.a.0: structural cycle
+c1.a.c.c: structural cycle
+d1.a.b.c.d.t: structural cycle
+d1.r: structural cycle
+d2.a.b.c.d.t: structural cycle
+d3.x.a.b.c: structural cycle
+d3.x.indirect: structural cycle
+e1.a.c: structural cycle
+e1.b.c: structural cycle
+e2.a.c: structural cycle
+e2.b.c: structural cycle
+e3.a: conflicting types list and struct
+e3.a.0: conflicting types list and struct
+e3.a.0: structural cycle
+e3.a.c: conflicting types list and struct
+e3.a.c: structural cycle
+e3.b: conflicting types list and struct
+e3.b.0: conflicting types list and struct
+e3.b.0: structural cycle
+e3.b.c: conflicting types list and struct
+e3.b.c: structural cycle
+z1.z.f.h.h: structural cycle
+z1.z.g.h: structural cycle
+d2.r: structural cycle:
+ ./in.cue:79:8
Result:
(_|_){
@@ -229,7 +257,7 @@
f: (_|_){
// [structural cycle]
0: (_|_){
- // [structural cycle] structural cycle
+ // [structural cycle] a1.f.0: structural cycle
0: (_|_){// 〈0;f〉
}
}
@@ -243,7 +271,7 @@
f: (_|_){
// [structural cycle]
g: (_|_){
- // [structural cycle] structural cycle
+ // [structural cycle] a3.f.g: structural cycle
g: (_|_){// 〈1;f〉
}
}
@@ -301,7 +329,7 @@
y: (_|_){
// [structural cycle]
0: (_|_){
- // [structural cycle] structural cycle
+ // [structural cycle] b4.x.y.0: structural cycle
0: (_|_){// 〈0;y〉
}
}
@@ -329,9 +357,9 @@
a: (_|_){
// [eval]
0: (_|_){
- // [eval] conflicting types
+ // [eval] b6.b.a.0: conflicting types list and int
0: (_|_){
- // [structural cycle] structural cycle
+ // [structural cycle] b6.b.a.0.0: structural cycle
}
}
}
@@ -341,7 +369,7 @@
a: (_|_){
// [structural cycle]
0: (_|_){
- // [structural cycle] structural cycle
+ // [structural cycle] b6.x.a.0: structural cycle
0: (_|_){// 〈0;a〉
}
}
@@ -358,7 +386,7 @@
a: (_|_){
// [structural cycle]
0: (_|_){
- // [structural cycle] structural cycle
+ // [structural cycle] b7.a.0: structural cycle
0: (_|_){// 〈0;a〉
}
}
@@ -375,7 +403,7 @@
b: (struct){
}
c: (_|_){
- // [structural cycle] structural cycle
+ // [structural cycle] c1.a.c.c: structural cycle
b: (_|_){// {}
}
c: (_|_){// (〈1;a〉 & 〈0;b〉)
@@ -396,7 +424,7 @@
// [structural cycle]
h: (int){ int }
t: (_|_){
- // [structural cycle] structural cycle
+ // [structural cycle] d1.a.b.c.d.t: structural cycle
c: (_|_){// {
// d: {
// h: int
@@ -410,7 +438,7 @@
}
}
r: (_|_){
- // [structural cycle] structural cycle
+ // [structural cycle] d1.r: structural cycle
c: (_|_){// {
// d: {
// h: int
@@ -429,7 +457,8 @@
// [structural cycle]
}
r: (_|_){
- // [structural cycle] structural cycle
+ // [structural cycle] d2.r: structural cycle:
+ // ./in.cue:79:8
c: (_|_){// {
// d: {
// h: int
@@ -448,7 +477,7 @@
// [structural cycle]
h: (int){ int }
t: (_|_){
- // [structural cycle] structural cycle
+ // [structural cycle] d2.a.b.c.d.t: structural cycle
c: (_|_){// {
// d: {
// h: int
@@ -480,14 +509,14 @@
b: (_|_){
// [structural cycle]
c: (_|_){
- // [structural cycle] structural cycle
+ // [structural cycle] d3.x.a.b.c: structural cycle
c: (_|_){// 〈2;indirect〉
}
}
}
}
indirect: (_|_){
- // [structural cycle] structural cycle
+ // [structural cycle] d3.x.indirect: structural cycle
c: (_|_){// 〈2;indirect〉
}
}
@@ -499,7 +528,7 @@
a: (_|_){
// [structural cycle]
c: (_|_){
- // [structural cycle] structural cycle
+ // [structural cycle] e1.a.c: structural cycle
c: (_|_){// 〈1;a〉
}
}
@@ -507,7 +536,7 @@
b: (_|_){
// [structural cycle]
c: (_|_){
- // [structural cycle] structural cycle
+ // [structural cycle] e1.b.c: structural cycle
c: (_|_){// 〈1;b〉
}
}
@@ -518,7 +547,7 @@
a: (_|_){
// [structural cycle]
c: (_|_){
- // [structural cycle] structural cycle
+ // [structural cycle] e2.a.c: structural cycle
c: (_|_){// 〈1;a〉
}
}
@@ -526,7 +555,7 @@
b: (_|_){
// [structural cycle]
c: (_|_){
- // [structural cycle] structural cycle
+ // [structural cycle] e2.b.c: structural cycle
c: (_|_){// 〈1;b〉
}
}
@@ -535,18 +564,18 @@
e3: (_|_){
// [eval]
a: (_|_){
- // [eval] conflicting types list and struct
+ // [eval] e3.a: conflicting types list and struct
c: (_|_){
- // [eval] conflicting types list and struct
- // structural cycle
+ // [eval] e3.a.c: conflicting types list and struct
+ // e3.a.c: structural cycle
c: (_|_){// 〈1;a〉
}
0: (_|_){// 〈0;a〉
}
}
0: (_|_){
- // [eval] conflicting types list and struct
- // structural cycle
+ // [eval] e3.a.0: conflicting types list and struct
+ // e3.a.0: structural cycle
c: (_|_){// 〈1;a〉
}
0: (_|_){// 〈0;a〉
@@ -554,18 +583,18 @@
}
}
b: (_|_){
- // [eval] conflicting types list and struct
+ // [eval] e3.b: conflicting types list and struct
c: (_|_){
- // [eval] conflicting types list and struct
- // structural cycle
+ // [eval] e3.b.c: conflicting types list and struct
+ // e3.b.c: structural cycle
c: (_|_){// 〈1;b〉
}
0: (_|_){// 〈0;b〉
}
}
0: (_|_){
- // [eval] conflicting types list and struct
- // structural cycle
+ // [eval] e3.b.0: conflicting types list and struct
+ // e3.b.0: structural cycle
c: (_|_){// 〈1;b〉
}
0: (_|_){// 〈0;b〉
@@ -692,7 +721,7 @@
h: (_|_){
// [structural cycle]
h: (_|_){
- // [structural cycle] structural cycle
+ // [structural cycle] z1.z.f.h.h: structural cycle
h: (_|_){// 〈1;g〉
}
}
@@ -701,7 +730,7 @@
g: (_|_){
// [structural cycle]
h: (_|_){
- // [structural cycle] structural cycle
+ // [structural cycle] z1.z.g.h: structural cycle
h: (_|_){// 〈1;g〉
}
}
diff --git a/cue/testdata/definitions/026_combined_definitions.txtar b/cue/testdata/definitions/026_combined_definitions.txtar
index ee3b170..3cea8a6 100644
--- a/cue/testdata/definitions/026_combined_definitions.txtar
+++ b/cue/testdata/definitions/026_combined_definitions.txtar
@@ -118,8 +118,8 @@
}
-- out/eval --
Errors:
-field `b` not allowed
-field `c` not allowed
+#D4.env: field `b` not allowed
+d1.env: field `c` not allowed
Result:
(_|_){
@@ -137,7 +137,7 @@
d1: (_|_){
// [eval]
env: (_|_){
- // [eval] field `c` not allowed
+ // [eval] d1.env: field `c` not allowed
a: (string){ "A" }
b: (string){ "B" }
c: (string){ "C" }
@@ -160,7 +160,7 @@
#D4: (_|_){
// [eval]
env: (_|_){
- // [eval] field `b` not allowed
+ // [eval] #D4.env: field `b` not allowed
a: (int){ int }
b: (int){ int }
}
diff --git a/cue/testdata/definitions/032_definitions_with_embedding.txtar b/cue/testdata/definitions/032_definitions_with_embedding.txtar
index b7a19c5..a60d57a 100644
--- a/cue/testdata/definitions/032_definitions_with_embedding.txtar
+++ b/cue/testdata/definitions/032_definitions_with_embedding.txtar
@@ -81,7 +81,7 @@
}
-- out/eval --
Errors:
-field `d` not allowed
+#e1.a: field `d` not allowed
Result:
(_|_){
@@ -101,7 +101,7 @@
#e1: (_|_){
// [eval]
a: (_|_){
- // [eval] field `d` not allowed
+ // [eval] #e1.a: field `d` not allowed
b: (int){ int }
c: (int){ int }
d: (int){ 4 }
diff --git "a/cue/testdata/definitions/033_Issue_\043153.txtar" "b/cue/testdata/definitions/033_Issue_\043153.txtar"
index ddb37ff..3b99002 100644
--- "a/cue/testdata/definitions/033_Issue_\043153.txtar"
+++ "b/cue/testdata/definitions/033_Issue_\043153.txtar"
@@ -62,7 +62,7 @@
}
-- out/eval --
Errors:
-field `b` not allowed
+listOfCloseds.0: field `b` not allowed
Result:
(_|_){
@@ -70,7 +70,7 @@
listOfCloseds: (_|_){
// [eval]
0: (_|_){
- // [eval] field `b` not allowed
+ // [eval] listOfCloseds.0: field `b` not allowed
a: (int){ |(*(int){ 0 }, (int){ int }) }
b: (int){ 2 }
}
diff --git a/cue/testdata/definitions/037_closing_with_comprehensions.txtar b/cue/testdata/definitions/037_closing_with_comprehensions.txtar
index e7db8de..25fc9b3 100644
--- a/cue/testdata/definitions/037_closing_with_comprehensions.txtar
+++ b/cue/testdata/definitions/037_closing_with_comprehensions.txtar
@@ -104,8 +104,9 @@
}
-- out/eval --
Errors:
-cannot mix bulk optional fields with dynamic fields, embeddings, or comprehensions within the same struct
-field `f3` not allowed
+#D: cannot mix bulk optional fields with dynamic fields, embeddings, or comprehensions within the same struct
+#E: field `f3` not allowed
+a: field `f3` not allowed
Result:
(_|_){
@@ -121,17 +122,17 @@
f1: (int){ int }
}
#D: (_|_){
- // [eval] cannot mix bulk optional fields with dynamic fields, embeddings, or comprehensions within the same struct
+ // [eval] #D: cannot mix bulk optional fields with dynamic fields, embeddings, or comprehensions within the same struct
f1: (int){ int }
}
#E: (_|_){
- // [eval] field `f3` not allowed
+ // [eval] #E: field `f3` not allowed
f1: (int){ int }
f2: (int){ int }
f3: (int){ int }
}
a: (_|_){
- // [eval] field `f3` not allowed
+ // [eval] a: field `f3` not allowed
f1: (int){ int }
f2: (int){ int }
f3: (int){ int }
diff --git a/cue/testdata/definitions/037_conjunction_of_optional_sets.txtar b/cue/testdata/definitions/037_conjunction_of_optional_sets.txtar
index 9847e4e..d3a9543 100644
--- a/cue/testdata/definitions/037_conjunction_of_optional_sets.txtar
+++ b/cue/testdata/definitions/037_conjunction_of_optional_sets.txtar
@@ -52,7 +52,8 @@
}
-- out/eval --
Errors:
-field `aaa` not allowed
+c: field `aaa` not allowed
+d: field `aaa` not allowed
Result:
(_|_){
@@ -64,13 +65,13 @@
#C: (#struct){
}
c: (_|_){
- // [eval] field `aaa` not allowed
+ // [eval] c: field `aaa` not allowed
aaa: (int){ 3 }
}
#D: (#struct){
}
d: (_|_){
- // [eval] field `aaa` not allowed
+ // [eval] d: field `aaa` not allowed
aaa: (int){ 3 }
}
}
diff --git a/cue/testdata/definitions/038_continue_recursive_closing_for_optionals.txtar b/cue/testdata/definitions/038_continue_recursive_closing_for_optionals.txtar
index 8132c7d..9c16b91 100644
--- a/cue/testdata/definitions/038_continue_recursive_closing_for_optionals.txtar
+++ b/cue/testdata/definitions/038_continue_recursive_closing_for_optionals.txtar
@@ -38,7 +38,7 @@
}
-- out/eval --
Errors:
-field `b` not allowed
+a.v: field `b` not allowed
Result:
(_|_){
@@ -48,7 +48,7 @@
a: (_|_){
// [eval]
v: (_|_){
- // [eval] field `b` not allowed
+ // [eval] a.v: field `b` not allowed
b: (int){ int }
a: (int){ int }
}
diff --git a/cue/testdata/eval/closed_disjunction.txtar b/cue/testdata/eval/closed_disjunction.txtar
index c2e142a..3691706 100644
--- a/cue/testdata/eval/closed_disjunction.txtar
+++ b/cue/testdata/eval/closed_disjunction.txtar
@@ -15,7 +15,7 @@
}
-- out/eval --
Errors:
-field `d` not allowed
+b: field `d` not allowed
Result:
(_|_){
@@ -27,7 +27,7 @@
c: (int){ 3 }
}
b: (_|_){
- // [eval] field `d` not allowed
+ // [eval] b: field `d` not allowed
c: (int){ 3 }
d: (int){ 4 }
}
diff --git a/cue/testdata/eval/closedness.txtar b/cue/testdata/eval/closedness.txtar
index 99e05de..8371eca 100644
--- a/cue/testdata/eval/closedness.txtar
+++ b/cue/testdata/eval/closedness.txtar
@@ -18,7 +18,7 @@
}
-- out/eval --
Errors:
-field `e` not allowed
+a.q: field `e` not allowed
Result:
(_|_){
@@ -37,7 +37,7 @@
// [eval]
b: (int){ 3 }
q: (_|_){
- // [eval] field `e` not allowed
+ // [eval] a.q: field `e` not allowed
c: (int){ 2 }
d: (int){ int }
e: (int){ 43 }
diff --git a/cue/testdata/eval/disjunctions.txtar b/cue/testdata/eval/disjunctions.txtar
index 608a0f9..fc6e002 100644
--- a/cue/testdata/eval/disjunctions.txtar
+++ b/cue/testdata/eval/disjunctions.txtar
@@ -17,7 +17,7 @@
-- out/eval --
Errors:
-invalid value string (mismatched types string and int)
+f.val: invalid value string (mismatched types string and int)
Result:
(_|_){
@@ -47,7 +47,7 @@
// [eval]
name: (string){ "str" }
val: (_|_){
- // [eval] invalid value string (mismatched types string and int)
+ // [eval] f.val: invalid value string (mismatched types string and int)
}
}
}
diff --git a/cue/testdata/eval/incomplete.txtar b/cue/testdata/eval/incomplete.txtar
index f302464..057693d 100644
--- a/cue/testdata/eval/incomplete.txtar
+++ b/cue/testdata/eval/incomplete.txtar
@@ -19,13 +19,13 @@
(struct){
s: (string){ string }
e1: (_|_){
- // [incomplete] non-concrete value string in operand to +:
+ // [incomplete] e1: non-concrete value string in operand to +:
// ./in.cue:3:5
}
e2: (string){ >"bar" }
e3: (string){ "foo" }
e4: (_|_){
- // [incomplete] non-concrete value string in operand to +:
+ // [incomplete] e1: non-concrete value string in operand to +:
// ./in.cue:3:5
}
e5: (_|_){
diff --git a/cue/testdata/eval/resolve_basic.txtar b/cue/testdata/eval/resolve_basic.txtar
index 9d04e0b..08be88e 100644
--- a/cue/testdata/eval/resolve_basic.txtar
+++ b/cue/testdata/eval/resolve_basic.txtar
@@ -16,7 +16,7 @@
d: (struct){
x: (_){ _ }
y: (_|_){
- // [incomplete] non-concrete value _ in operand to +:
+ // [incomplete] d.y: non-concrete value _ in operand to +:
// ./in.cue:5:6
}
}
diff --git a/cue/testdata/eval/selectors.txtar b/cue/testdata/eval/selectors.txtar
index 9d04e0b..08be88e 100644
--- a/cue/testdata/eval/selectors.txtar
+++ b/cue/testdata/eval/selectors.txtar
@@ -16,7 +16,7 @@
d: (struct){
x: (_){ _ }
y: (_|_){
- // [incomplete] non-concrete value _ in operand to +:
+ // [incomplete] d.y: non-concrete value _ in operand to +:
// ./in.cue:5:6
}
}
diff --git a/cue/testdata/export/006.txtar b/cue/testdata/export/006.txtar
index 5396597..4fd285f 100644
--- a/cue/testdata/export/006.txtar
+++ b/cue/testdata/export/006.txtar
@@ -33,15 +33,15 @@
}
b: (float){ 2.0 }
c: (_|_){
- // [incomplete] undefined field c:
+ // [incomplete] c: undefined field c:
// ./in.cue:1:38
}
d: (_|_){
- // [incomplete] undefined field d:
+ // [incomplete] d: undefined field d:
// ./in.cue:1:46
}
e: (_|_){
- // [incomplete] undefined field t:
+ // [incomplete] e: undefined field t:
// ./in.cue:1:57
}
}
diff --git a/cue/testdata/export/007.txtar b/cue/testdata/export/007.txtar
index c7f9841..d69ae88 100644
--- a/cue/testdata/export/007.txtar
+++ b/cue/testdata/export/007.txtar
@@ -27,8 +27,12 @@
}
-- out/eval --
Errors:
-undefined field c:
+c: undefined field c:
./in.cue:1:41
+d: undefined field d:
+ ./in.cue:1:50
+e: undefined field t:
+ ./in.cue:1:62
Result:
(_|_){
@@ -39,15 +43,15 @@
}
b: (float){ 2.0 }
c: (_|_){
- // [eval] undefined field c:
+ // [eval] c: undefined field c:
// ./in.cue:1:41
}
d: (_|_){
- // [eval] undefined field d:
+ // [eval] d: undefined field d:
// ./in.cue:1:50
}
e: (_|_){
- // [eval] undefined field t:
+ // [eval] e: undefined field t:
// ./in.cue:1:62
}
}
diff --git a/cue/testdata/export/008.txtar b/cue/testdata/export/008.txtar
index ee0c8c6..07c94c0 100644
--- a/cue/testdata/export/008.txtar
+++ b/cue/testdata/export/008.txtar
@@ -16,7 +16,7 @@
}
-- out/eval --
Errors:
-incompatible values 4 and 3
+a.0: incompatible values 4 and 3
Result:
(_|_){
@@ -24,7 +24,7 @@
a: (_|_){
// [eval]
0: (_|_){
- // [eval] incompatible values 4 and 3
+ // [eval] a.0: incompatible values 4 and 3
}
}
}
diff --git a/cue/testdata/export/012.txtar b/cue/testdata/export/012.txtar
index 55a79da..01111cd 100644
--- a/cue/testdata/export/012.txtar
+++ b/cue/testdata/export/012.txtar
@@ -18,7 +18,7 @@
(struct){
a: ((int|string)){ |(*(string){ "foo" }, *(string){ "bar" }, *(string){ string }, (int){ int }) }
b: (_|_){
- // [incomplete] non-concrete slice subject a:
+ // [incomplete] b: non-concrete slice subject a:
// ./in.cue:1:41
}
}
diff --git a/cue/testdata/export/019.txtar b/cue/testdata/export/019.txtar
index bc1c2d8..ea12d29 100644
--- a/cue/testdata/export/019.txtar
+++ b/cue/testdata/export/019.txtar
@@ -16,7 +16,7 @@
}
-- out/eval --
Errors:
-invalid interpolation: cannot use >=0 & <=10 (type number) as type string:
+b: invalid interpolation: cannot use >=0 & <=10 (type number) as type string:
./in.cue:1:20
Result:
@@ -24,7 +24,7 @@
// [eval]
a: (number){ &(>=0, <=10) }
b: (_|_){
- // [eval] invalid interpolation: cannot use >=0 & <=10 (type number) as type string:
+ // [eval] b: invalid interpolation: cannot use >=0 & <=10 (type number) as type string:
// ./in.cue:1:20
}
}
diff --git a/cue/testdata/export/021.txtar b/cue/testdata/export/021.txtar
index 05d6c3e..822ef79 100644
--- a/cue/testdata/export/021.txtar
+++ b/cue/testdata/export/021.txtar
@@ -46,7 +46,7 @@
(struct){
b: (struct){
idx: (_|_){
- // [incomplete] invalid non-ground value string (must be concrete string)
+ // [incomplete] b.idx: invalid non-ground value string (must be concrete string)
}
str: (string){ string }
a: (struct){
diff --git a/cue/testdata/export/025.txtar b/cue/testdata/export/025.txtar
index 6bf3c9b..78d23b1 100644
--- a/cue/testdata/export/025.txtar
+++ b/cue/testdata/export/025.txtar
@@ -43,7 +43,7 @@
-- out/eval --
(struct){
b: (_|_){
- // [incomplete] invalid non-ground value int (must be concrete int)
+ // [incomplete] b: invalid non-ground value int (must be concrete int)
}
a: (int){ int }
c: (int){ |(*(int){ 1 }, (int){ 2 }) }
diff --git a/cue/testdata/fulleval/000_detect_conflicting_value.txtar b/cue/testdata/fulleval/000_detect_conflicting_value.txtar
index 2e5a97f..a4a9787 100644
--- a/cue/testdata/fulleval/000_detect_conflicting_value.txtar
+++ b/cue/testdata/fulleval/000_detect_conflicting_value.txtar
@@ -18,6 +18,6 @@
-- out/eval --
(struct){
a: (_|_){
- // [incomplete] empty disjunction
+ // [incomplete] a: empty disjunction
}
}
diff --git a/cue/testdata/fulleval/018_recursive_evaluation_within_list.txtar b/cue/testdata/fulleval/018_recursive_evaluation_within_list.txtar
index dbacf97..79d2de4 100644
--- a/cue/testdata/fulleval/018_recursive_evaluation_within_list.txtar
+++ b/cue/testdata/fulleval/018_recursive_evaluation_within_list.txtar
@@ -86,7 +86,7 @@
}
b1: (struct){
d: (_|_){
- // [incomplete] non-concrete value string in operand to +:
+ // [incomplete] b1.d: non-concrete value string in operand to +:
// ./in.cue:10:5
}
c: (string){ string }
diff --git a/cue/testdata/fulleval/020_complex_interaction_of_groundness.txtar b/cue/testdata/fulleval/020_complex_interaction_of_groundness.txtar
index dadb8f8..1b31de5 100644
--- a/cue/testdata/fulleval/020_complex_interaction_of_groundness.txtar
+++ b/cue/testdata/fulleval/020_complex_interaction_of_groundness.txtar
@@ -72,7 +72,7 @@
c: (struct){
d: (string){ string }
s: (_|_){
- // [incomplete] non-concrete value string in operand to +:
+ // [incomplete] a.b.c.s: non-concrete value string in operand to +:
// ./in.cue:4:34
}
}
diff --git a/cue/testdata/fulleval/021_complex_groundness_2.txtar b/cue/testdata/fulleval/021_complex_groundness_2.txtar
index c332769..50a9f11 100644
--- a/cue/testdata/fulleval/021_complex_groundness_2.txtar
+++ b/cue/testdata/fulleval/021_complex_groundness_2.txtar
@@ -83,9 +83,9 @@
res: (struct){
d: (string){ string }
s: (_|_){
- // [incomplete] non-concrete value string in operand to +:
+ // [incomplete] f1.res.s: non-concrete value string in operand to +:
// ./in.cue:5:25
- // non-concrete value string in operand to +:
+ // f1.res.s: non-concrete value string in operand to +:
// ./in.cue:6:34
}
}
@@ -95,9 +95,9 @@
c: (struct){
d: (string){ string }
s: (_|_){
- // [incomplete] non-concrete value string in operand to +:
+ // [incomplete] a.b.c.s: non-concrete value string in operand to +:
// ./in.cue:5:25
- // non-concrete value string in operand to +:
+ // a.b.c.s: non-concrete value string in operand to +:
// ./in.cue:6:34
}
}
diff --git "a/cue/testdata/fulleval/024_Issue_\04323.txtar" "b/cue/testdata/fulleval/024_Issue_\04323.txtar"
index a2da8e2..0f41876 100644
--- "a/cue/testdata/fulleval/024_Issue_\04323.txtar"
+++ "b/cue/testdata/fulleval/024_Issue_\04323.txtar"
@@ -28,7 +28,7 @@
}
-- out/eval --
Errors:
-incompatible values 2 and 3
+y.a: incompatible values 2 and 3
Result:
(_|_){
@@ -41,7 +41,7 @@
y: (_|_){
// [eval]
a: (_|_){
- // [eval] incompatible values 2 and 3
+ // [eval] y.a: incompatible values 2 and 3
}
}
}
diff --git a/cue/testdata/fulleval/026_dont_convert_incomplete_errors_to_non-incomplete.txtar b/cue/testdata/fulleval/026_dont_convert_incomplete_errors_to_non-incomplete.txtar
index b6e88bd..c640f19 100644
--- a/cue/testdata/fulleval/026_dont_convert_incomplete_errors_to_non-incomplete.txtar
+++ b/cue/testdata/fulleval/026_dont_convert_incomplete_errors_to_non-incomplete.txtar
@@ -55,35 +55,35 @@
}
}
n2: (_|_){
- // [incomplete] operand -num of '-' not concrete (was number):
+ // [incomplete] n2: operand -num of '-' not concrete (was number):
// ./in.cue:4:6
}
n3: (_|_){
- // [incomplete] operand +num of '+' not concrete (was number):
+ // [incomplete] n3: operand +num of '+' not concrete (was number):
// ./in.cue:5:6
}
n4: (_|_){
- // [incomplete] non-concrete value <4 in operand to +:
+ // [incomplete] n4: non-concrete value <4 in operand to +:
// ./in.cue:6:5
}
n5: (_|_){
- // [incomplete] non-concrete value <4 in operand to -:
+ // [incomplete] n5: non-concrete value <4 in operand to -:
// ./in.cue:7:5
}
n6: (_|_){
- // [incomplete] non-concrete value <4 in operand to *:
+ // [incomplete] n6: non-concrete value <4 in operand to *:
// ./in.cue:8:5
}
n7: (_|_){
- // [incomplete] non-concrete value <4 in operand to /:
+ // [incomplete] n7: non-concrete value <4 in operand to /:
// ./in.cue:9:5
}
b1: (_|_){
- // [incomplete] operand !is of '!' not concrete (was bool):
+ // [incomplete] b1: operand !is of '!' not concrete (was bool):
// ./in.cue:11:6
}
s1: (_|_){
- // [incomplete] invalid interpolation: incomplete string value 'string':
+ // [incomplete] s1: invalid interpolation: incomplete string value 'string':
// ./in.cue:13:5
}
s2: (string){ strings.ContainsAny("dd") }
diff --git a/cue/testdata/fulleval/027_len_of_incomplete_types.txtar b/cue/testdata/fulleval/027_len_of_incomplete_types.txtar
index d76583f..a2f2aeb 100644
--- a/cue/testdata/fulleval/027_len_of_incomplete_types.txtar
+++ b/cue/testdata/fulleval/027_len_of_incomplete_types.txtar
@@ -41,16 +41,16 @@
v3: (int){ 0 }
v4: (int){ 1 }
v5: (_|_){
- // [incomplete] unresolved disjunction {a:3} | {a:4} (type struct):
+ // [incomplete] v5: unresolved disjunction {a:3} | {a:4} (type struct):
// ./in.cue:6:7
}
v6: (_|_){
- // [incomplete] unresolved disjunction 'sf' | 'dd' (type bytes):
+ // [incomplete] v6: unresolved disjunction 'sf' | 'dd' (type bytes):
// ./in.cue:7:7
}
v7: (int){ 2 }
v8: (_|_){
- // [incomplete] unresolved disjunction [2] | [1,2] (type list):
+ // [incomplete] v8: unresolved disjunction [2] | [1,2] (type list):
// ./in.cue:9:7
}
v9: (int){ 4 }
diff --git "a/cue/testdata/fulleval/029_Issue_\04394.txtar" "b/cue/testdata/fulleval/029_Issue_\04394.txtar"
index e15758e..231bb0d 100644
--- "a/cue/testdata/fulleval/029_Issue_\04394.txtar"
+++ "b/cue/testdata/fulleval/029_Issue_\04394.txtar"
@@ -97,7 +97,7 @@
}
select: (struct){
opt: (_|_){
- // [incomplete] undefined field opt:
+ // [incomplete] select.opt: undefined field opt:
// ./in.cue:10:15
}
txt: (int){ 2 }
@@ -107,17 +107,17 @@
}
index: (struct){
opt: (_|_){
- // [incomplete] undefined field opt:
+ // [incomplete] index.opt: undefined field opt:
// ./in.cue:17:15
}
txt: (int){ 2 }
#def: (_|_){
- // [incomplete] undefined field "#def":
+ // [incomplete] index.#def: undefined field "#def":
// ./in.cue:19:15
}
regular: (int){ 4 }
_hidden: (_|_){
- // [incomplete] undefined field "_hidden":
+ // [incomplete] index._hidden: undefined field "_hidden":
// ./in.cue:21:15
}
}
diff --git a/cue/testdata/fulleval/031_comparison_against_bottom.txtar b/cue/testdata/fulleval/031_comparison_against_bottom.txtar
index 14db904..c0cceeb 100644
--- a/cue/testdata/fulleval/031_comparison_against_bottom.txtar
+++ b/cue/testdata/fulleval/031_comparison_against_bottom.txtar
@@ -61,7 +61,7 @@
}
-- out/eval --
Errors:
-incompatible values 2 and 1:
+err: incompatible values 2 and 1:
./in.cue:2:4
Result:
@@ -69,13 +69,13 @@
// [eval]
a: (bool){ true }
b: (_|_){
- // [eval] incompatible values 2 and 1:
+ // [eval] err: incompatible values 2 and 1:
// ./in.cue:2:4
}
c: (bool){ true }
d: (bool){ false }
e: (_|_){
- // [eval] incompatible values 2 and 1:
+ // [eval] err: incompatible values 2 and 1:
// ./in.cue:2:4
}
f: (bool){ true }
@@ -83,7 +83,7 @@
h: (bool){ true }
i: (bool){ false }
err: (_|_){
- // [eval] incompatible values 2 and 1:
+ // [eval] err: incompatible values 2 and 1:
// ./in.cue:2:4
}
}
diff --git a/cue/testdata/fulleval/035_optionals_with_label_filters.txtar b/cue/testdata/fulleval/035_optionals_with_label_filters.txtar
index a26c0b3..40eda99 100644
--- a/cue/testdata/fulleval/035_optionals_with_label_filters.txtar
+++ b/cue/testdata/fulleval/035_optionals_with_label_filters.txtar
@@ -102,10 +102,11 @@
}
-- out/eval --
Errors:
-field `cmd` not allowed
-field `foo1` not allowed
-field `fooTest1` not allowed
-invalid value "badName" (out of bound =~"^test")
+jobs1: field `foo1` not allowed
+jobs3: field `fooTest1` not allowed
+jobs3.fooTest1: field `cmd` not allowed
+jobs2.fooTest.name: invalid value "badName" (out of bound =~"^test"):
+ ./in.cue:9:22
Result:
(_|_){
@@ -123,7 +124,7 @@
}
}
jobs1: (_|_){
- // [eval] field `foo1` not allowed
+ // [eval] jobs1: field `foo1` not allowed
foo1: (#struct){
}
}
@@ -132,15 +133,16 @@
fooTest: (_|_){
// [eval]
name: (_|_){
- // [eval] invalid value "badName" (out of bound =~"^test")
+ // [eval] jobs2.fooTest.name: invalid value "badName" (out of bound =~"^test"):
+ // ./in.cue:9:22
}
cmd: (string){ string }
}
}
jobs3: (_|_){
- // [eval] field `fooTest1` not allowed
+ // [eval] jobs3: field `fooTest1` not allowed
fooTest1: (_|_){
- // [eval] field `cmd` not allowed
+ // [eval] jobs3.fooTest1: field `cmd` not allowed
name: (string){ "badName" }
cmd: (string){ string }
}
diff --git a/cue/testdata/fulleval/046_non-structural_direct_cycles.txtar b/cue/testdata/fulleval/046_non-structural_direct_cycles.txtar
index f711acd..bd2174a 100644
--- a/cue/testdata/fulleval/046_non-structural_direct_cycles.txtar
+++ b/cue/testdata/fulleval/046_non-structural_direct_cycles.txtar
@@ -29,14 +29,14 @@
-- out/eval --
(struct){
c1: (_|_){
- // [incomplete] undefined field bar:
+ // [incomplete] c1: undefined field bar:
// ./in.cue:1:24
bar: (struct){
baz: (int){ 2 }
}
}
c2: (_|_){
- // [incomplete] undefined field bar:
+ // [incomplete] c2: undefined field bar:
// ./in.cue:2:24
bar: (int){ 1 }
}
diff --git a/cue/testdata/fulleval/050_json_Marshaling_detects_incomplete.txtar b/cue/testdata/fulleval/050_json_Marshaling_detects_incomplete.txtar
index 0c5f6a0..f8f2f4e 100644
--- a/cue/testdata/fulleval/050_json_Marshaling_detects_incomplete.txtar
+++ b/cue/testdata/fulleval/050_json_Marshaling_detects_incomplete.txtar
@@ -30,12 +30,12 @@
foo: (struct){
a: (int){ 3 }
b: (_|_){
- // [incomplete] undefined field c:
+ // [incomplete] foo.b: undefined field c:
// ./in.cue:5:20
}
}
b: (_|_){
- // [incomplete] undefined field c:
+ // [incomplete] foo.b: undefined field c:
// ./in.cue:5:20
}
}
diff --git a/cue/testdata/fulleval/055_issue318.txtar b/cue/testdata/fulleval/055_issue318.txtar
index ba787a3..b43df71 100644
--- a/cue/testdata/fulleval/055_issue318.txtar
+++ b/cue/testdata/fulleval/055_issue318.txtar
@@ -43,11 +43,11 @@
}
-- out/eval --
Errors:
-invalid interpolation: undefined field y:
+#T.out1: invalid interpolation: undefined field y:
./in.cue:3:8
-invalid interpolation: undefined field y:
+#T.out2: invalid interpolation: undefined field y:
./in.cue:4:8
-undefined field y:
+#T.vy: undefined field y:
./in.cue:6:12
Result:
@@ -59,16 +59,16 @@
x: (string){ string }
}
out1: (_|_){
- // [eval] invalid interpolation: undefined field y:
+ // [eval] #T.out1: invalid interpolation: undefined field y:
// ./in.cue:3:8
}
out2: (_|_){
- // [eval] invalid interpolation: undefined field y:
+ // [eval] #T.out2: invalid interpolation: undefined field y:
// ./in.cue:4:8
}
vx: (string){ string }
vy: (_|_){
- // [eval] undefined field y:
+ // [eval] #T.vy: undefined field y:
// ./in.cue:6:12
}
}
diff --git a/cue/testdata/interpolation/041_interpolation.txtar b/cue/testdata/interpolation/041_interpolation.txtar
index ea2955d..06a2adc 100644
--- a/cue/testdata/interpolation/041_interpolation.txtar
+++ b/cue/testdata/interpolation/041_interpolation.txtar
@@ -33,7 +33,7 @@
}
-- out/eval --
Errors:
-invalid interpolation: cannot use [] (type list) as type string:
+e: invalid interpolation: cannot use [] (type list) as type string:
./in.cue:7:4
Result:
@@ -43,16 +43,16 @@
b: (string){ "one 4 two 4one" }
c: (string){ "one" }
d: (_|_){
- // [incomplete] invalid interpolation: incomplete string value '_':
+ // [incomplete] d: invalid interpolation: incomplete string value '_':
// ./in.cue:4:4
}
u: (_|_){
- // [incomplete] invalid interpolation: incomplete string value '_':
+ // [incomplete] u: invalid interpolation: incomplete string value '_':
// ./in.cue:5:4
}
r: (_){ _ }
e: (_|_){
- // [eval] invalid interpolation: cannot use [] (type list) as type string:
+ // [eval] e: invalid interpolation: cannot use [] (type list) as type string:
// ./in.cue:7:4
}
}
diff --git a/cue/testdata/lists/019_list_types.txtar b/cue/testdata/lists/019_list_types.txtar
index fc789f2..9c3a443 100644
--- a/cue/testdata/lists/019_list_types.txtar
+++ b/cue/testdata/lists/019_list_types.txtar
@@ -118,7 +118,7 @@
}
-- out/eval --
Errors:
-incompatible list lengths (1 and 2)
+e0: incompatible list lengths (1 and 2)
Result:
(_|_){
@@ -153,7 +153,7 @@
t1: (list){
}
e0: (_|_){
- // [eval] incompatible list lengths (1 and 2)
+ // [eval] e0: incompatible list lengths (1 and 2)
0: (struct){
}
1: (struct){
diff --git a/cue/testdata/lists/020_list_arithmetic.txtar b/cue/testdata/lists/020_list_arithmetic.txtar
index cfc9f85..3f0360c 100644
--- a/cue/testdata/lists/020_list_arithmetic.txtar
+++ b/cue/testdata/lists/020_list_arithmetic.txtar
@@ -338,7 +338,7 @@
}
-- out/eval --
Errors:
-value can never become concrete:
+l5: value can never become concrete:
./in.cue:6:12
Result:
@@ -360,15 +360,15 @@
l2: (#list){
}
l3: (_|_){
- // [incomplete] non-concrete value <=2 in operand to *:
+ // [incomplete] l3: non-concrete value <=2 in operand to *:
// ./in.cue:4:5
}
l4: (_|_){
- // [incomplete] non-concrete value <=2 in operand to *:
+ // [incomplete] l4: non-concrete value <=2 in operand to *:
// ./in.cue:5:5
}
l5: (_|_){
- // [eval] value can never become concrete:
+ // [eval] l5: value can never become concrete:
// ./in.cue:6:12
}
l6: (#list){
diff --git a/cue/testdata/resolve/006_arithmetic.txtar b/cue/testdata/resolve/006_arithmetic.txtar
index 9542e1d..8ee0e1c 100644
--- a/cue/testdata/resolve/006_arithmetic.txtar
+++ b/cue/testdata/resolve/006_arithmetic.txtar
@@ -30,7 +30,7 @@
}
-- out/eval --
Errors:
-invalid value 2 (mismatched types float and int)
+e2: invalid value 2 (mismatched types float and int)
Result:
(_|_){
@@ -41,6 +41,6 @@
v5: (float){ 2.0 }
v6: (float){ 1 }
e2: (_|_){
- // [eval] invalid value 2 (mismatched types float and int)
+ // [eval] e2: invalid value 2 (mismatched types float and int)
}
}
diff --git a/cue/testdata/resolve/010_optional_field_resolves_to_incomplete.txtar b/cue/testdata/resolve/010_optional_field_resolves_to_incomplete.txtar
index 7b017da..50df2cb 100644
--- a/cue/testdata/resolve/010_optional_field_resolves_to_incomplete.txtar
+++ b/cue/testdata/resolve/010_optional_field_resolves_to_incomplete.txtar
@@ -29,11 +29,11 @@
(struct){
r: (struct){
b: (_|_){
- // [incomplete] undefined field a:
+ // [incomplete] r.b: undefined field a:
// ./in.cue:3:6
}
c: (_|_){
- // [incomplete] undefined field a:
+ // [incomplete] r.c: undefined field a:
// ./in.cue:4:8
}
}
diff --git a/cue/testdata/resolve/011_bounds.txtar b/cue/testdata/resolve/011_bounds.txtar
index 7fdc302..134204f 100644
--- a/cue/testdata/resolve/011_bounds.txtar
+++ b/cue/testdata/resolve/011_bounds.txtar
@@ -138,15 +138,17 @@
}
-- out/eval --
Errors:
-bounds >1 <0
-bounds >11 <11
-bounds >11 <=11
-bounds >=11 <11
-invalid value !=null (mismatched types (bool|string|bytes|list|struct|number) and null)
-invalid value 0 (out of bound <0)
-invalid value 1 (out of bound >1)
-invalid value <1 (mismatched types number and string)
-invalid value null (mismatched types null and (bool|string|bytes|list|struct|number))
+e1: invalid value !=null (mismatched types (bool|string|bytes|list|struct|number) and null)
+e2: invalid value null (mismatched types null and (bool|string|bytes|list|struct|number))
+e5: incompatible bounds >1 and <0
+e6: incompatible bounds >11 and <11
+e7: incompatible bounds >=11 and <11
+e8: incompatible bounds >11 and <=11
+e9: invalid value <1 (mismatched types number and string)
+e3: invalid value 1 (out of bound >1):
+ ./in.cue:42:5
+e4: invalid value 0 (out of bound <0):
+ ./in.cue:43:5
Result:
(_|_){
@@ -182,30 +184,32 @@
s23e: (number){ &(>0.0, <2.0) }
s30: (int){ &(>0, int) }
e1: (_|_){
- // [eval] invalid value !=null (mismatched types (bool|string|bytes|list|struct|number) and null)
+ // [eval] e1: invalid value !=null (mismatched types (bool|string|bytes|list|struct|number) and null)
}
e2: (_|_){
- // [eval] invalid value null (mismatched types null and (bool|string|bytes|list|struct|number))
+ // [eval] e2: invalid value null (mismatched types null and (bool|string|bytes|list|struct|number))
}
e3: (_|_){
- // [eval] invalid value 1 (out of bound >1)
+ // [eval] e3: invalid value 1 (out of bound >1):
+ // ./in.cue:42:5
}
e4: (_|_){
- // [eval] invalid value 0 (out of bound <0)
+ // [eval] e4: invalid value 0 (out of bound <0):
+ // ./in.cue:43:5
}
e5: (_|_){
- // [eval] bounds >1 <0
+ // [eval] e5: incompatible bounds >1 and <0
}
e6: (_|_){
- // [eval] bounds >11 <11
+ // [eval] e6: incompatible bounds >11 and <11
}
e7: (_|_){
- // [eval] bounds >=11 <11
+ // [eval] e7: incompatible bounds >=11 and <11
}
e8: (_|_){
- // [eval] bounds >11 <=11
+ // [eval] e8: incompatible bounds >11 and <=11
}
e9: (_|_){
- // [eval] invalid value <1 (mismatched types number and string)
+ // [eval] e9: invalid value <1 (mismatched types number and string)
}
}
diff --git a/cue/testdata/resolve/012_bound_conversions.txtar b/cue/testdata/resolve/012_bound_conversions.txtar
index a1fe706..396beea 100644
--- a/cue/testdata/resolve/012_bound_conversions.txtar
+++ b/cue/testdata/resolve/012_bound_conversions.txtar
@@ -48,8 +48,11 @@
}
-- out/eval --
Errors:
-invalid value 1.2 (out of bound >1.3)
-invalid value int (mismatched types int and float)
+c4: invalid value int (mismatched types int and float)
+c1: invalid value 1.2 (out of bound >1.3):
+ ./in.cue:10:12
+c2: invalid value 1.2 (out of bound >1.3):
+ ./in.cue:11:12
Result:
(_|_){
@@ -62,13 +65,15 @@
r5: (number){ 1.1 }
r6: (number){ 1.1 }
c1: (_|_){
- // [eval] invalid value 1.2 (out of bound >1.3)
+ // [eval] c1: invalid value 1.2 (out of bound >1.3):
+ // ./in.cue:10:12
}
c2: (_|_){
- // [eval] invalid value 1.2 (out of bound >1.3)
+ // [eval] c2: invalid value 1.2 (out of bound >1.3):
+ // ./in.cue:11:12
}
c3: (float){ 1.2 }
c4: (_|_){
- // [eval] invalid value int (mismatched types int and float)
+ // [eval] c4: invalid value int (mismatched types int and float)
}
}
diff --git a/cue/testdata/resolve/013_custom_validators.txtar b/cue/testdata/resolve/013_custom_validators.txtar
index 8a245c9..6ec7803 100644
--- a/cue/testdata/resolve/013_custom_validators.txtar
+++ b/cue/testdata/resolve/013_custom_validators.txtar
@@ -21,14 +21,16 @@
<0>{a: "after", b: _|_(strings.ContainsAny ("c"):invalid value "dog" (does not satisfy strings.ContainsAny("c"))), c: "dog"}
-- out/eval --
Errors:
-invalid value "dog" (does not satisfy strings.ContainsAny("c"))
+b: invalid value "dog" (does not satisfy strings.ContainsAny("c")):
+ ./in.cue:6:4
Result:
(_|_){
// [eval]
a: (string){ "after" }
b: (_|_){
- // [eval] invalid value "dog" (does not satisfy strings.ContainsAny("c"))
+ // [eval] b: invalid value "dog" (does not satisfy strings.ContainsAny("c")):
+ // ./in.cue:6:4
}
c: (string){ "dog" }
}
diff --git a/cue/testdata/resolve/016_index.txtar b/cue/testdata/resolve/016_index.txtar
index f0ce0fc..83d7cea 100644
--- a/cue/testdata/resolve/016_index.txtar
+++ b/cue/testdata/resolve/016_index.txtar
@@ -78,21 +78,21 @@
}
-- out/eval --
Errors:
-invalid list index "3" (type string):
+c: invalid list index "3" (type string):
./in.cue:3:20
-undefined field 0:
+d: undefined field 0:
./in.cue:4:16
-invalid list index _ (type string):
+e1: invalid list index _ (type string):
./in.cue:6:9
-invalid operand 2 (found int, want list or struct):
+e2: invalid operand 2 (found int, want list or struct):
./in.cue:7:5
-invalid label type bool:
+e3: invalid label type bool:
./in.cue:8:5
-undefined field 3:
+e4: undefined field 3:
./in.cue:9:15
-invalid negative index -1:
+e5: invalid negative index -1:
./in.cue:10:5
-invalid list index 1 (out of bounds):
+e6: invalid list index 1 (out of bounds):
./in.cue:11:16
Result:
@@ -101,37 +101,37 @@
a: (int){ 2 }
b: (string){ "bar" }
c: (_|_){
- // [eval] invalid list index "3" (type string):
+ // [eval] c: invalid list index "3" (type string):
// ./in.cue:3:20
}
d: (_|_){
- // [eval] undefined field 0:
+ // [eval] d: undefined field 0:
// ./in.cue:4:16
}
l: (#list){
}
e1: (_|_){
- // [eval] invalid list index _ (type string):
+ // [eval] e1: invalid list index _ (type string):
// ./in.cue:6:9
}
e2: (_|_){
- // [eval] invalid operand 2 (found int, want list or struct):
+ // [eval] e2: invalid operand 2 (found int, want list or struct):
// ./in.cue:7:5
}
e3: (_|_){
- // [eval] invalid label type bool:
+ // [eval] e3: invalid label type bool:
// ./in.cue:8:5
}
e4: (_|_){
- // [eval] undefined field 3:
+ // [eval] e4: undefined field 3:
// ./in.cue:9:15
}
e5: (_|_){
- // [eval] invalid negative index -1:
+ // [eval] e5: invalid negative index -1:
// ./in.cue:10:5
}
e6: (_|_){
- // [eval] invalid list index 1 (out of bounds):
+ // [eval] e6: invalid list index 1 (out of bounds):
// ./in.cue:11:16
}
def: (struct){
@@ -139,7 +139,7 @@
#b: (int){ 3 }
}
e7: (_|_){
- // [incomplete] undefined field b:
+ // [incomplete] e7: undefined field b:
// ./in.cue:16:9
}
}
diff --git a/cue/testdata/resolve/018_slice.txtar b/cue/testdata/resolve/018_slice.txtar
index 28b206d..775ba8f 100644
--- a/cue/testdata/resolve/018_slice.txtar
+++ b/cue/testdata/resolve/018_slice.txtar
@@ -53,19 +53,19 @@
}
-- out/eval --
Errors:
-index 1 out of range:
+e1: index 1 out of range:
./in.cue:3:5
-cannot convert negative number to uint64:
+e2: cannot convert negative number to uint64:
./in.cue:4:5
-invalid slice index: 1 > 0:
+e3: invalid slice index: 1 > 0:
./in.cue:5:5
-index 2 out of range:
+e4: index 2 out of range:
./in.cue:6:5
-cannot slice 4 (type int):
+e5: cannot slice 4 (type int):
./in.cue:7:5
-cannot use "" (type string) as type int in slice index:
+e6: cannot use "" (type string) as type int in slice index:
./in.cue:8:5
-cannot use "9" (type string) as type int in slice index:
+e7: cannot use "9" (type string) as type int in slice index:
./in.cue:9:5
Result:
@@ -76,31 +76,31 @@
b: (#list){
}
e1: (_|_){
- // [eval] index 1 out of range:
+ // [eval] e1: index 1 out of range:
// ./in.cue:3:5
}
e2: (_|_){
- // [eval] cannot convert negative number to uint64:
+ // [eval] e2: cannot convert negative number to uint64:
// ./in.cue:4:5
}
e3: (_|_){
- // [eval] invalid slice index: 1 > 0:
+ // [eval] e3: invalid slice index: 1 > 0:
// ./in.cue:5:5
}
e4: (_|_){
- // [eval] index 2 out of range:
+ // [eval] e4: index 2 out of range:
// ./in.cue:6:5
}
e5: (_|_){
- // [eval] cannot slice 4 (type int):
+ // [eval] e5: cannot slice 4 (type int):
// ./in.cue:7:5
}
e6: (_|_){
- // [eval] cannot use "" (type string) as type int in slice index:
+ // [eval] e6: cannot use "" (type string) as type int in slice index:
// ./in.cue:8:5
}
e7: (_|_){
- // [eval] cannot use "9" (type string) as type int in slice index:
+ // [eval] e7: cannot use "9" (type string) as type int in slice index:
// ./in.cue:9:5
}
}
diff --git a/cue/testdata/resolve/023_correct_error_messages.txtar b/cue/testdata/resolve/023_correct_error_messages.txtar
index 9d79f85..fd66f0a 100644
--- a/cue/testdata/resolve/023_correct_error_messages.txtar
+++ b/cue/testdata/resolve/023_correct_error_messages.txtar
@@ -15,12 +15,12 @@
}
-- out/eval --
Errors:
-invalid value 1 (mismatched types int and string)
+a: invalid value 1 (mismatched types int and string)
Result:
(_|_){
// [eval]
a: (_|_){
- // [eval] invalid value 1 (mismatched types int and string)
+ // [eval] a: invalid value 1 (mismatched types int and string)
}
}
diff --git a/cue/testdata/resolve/024_structs.txtar b/cue/testdata/resolve/024_structs.txtar
index 0f09834..7d16014 100644
--- a/cue/testdata/resolve/024_structs.txtar
+++ b/cue/testdata/resolve/024_structs.txtar
@@ -53,14 +53,14 @@
t: (struct){
c: (number){ number }
d: (_|_){
- // [incomplete] non-concrete value number in operand to *:
+ // [incomplete] t.d: non-concrete value number in operand to *:
// ./in.cue:3:19
}
}
ti: (struct){
c: (int){ int }
d: (_|_){
- // [incomplete] non-concrete value int in operand to *:
+ // [incomplete] ti.d: non-concrete value int in operand to *:
// ./in.cue:3:19
}
}
diff --git a/cue/testdata/resolve/025_definitions.txtar b/cue/testdata/resolve/025_definitions.txtar
index ba11189..d2eab90 100644
--- a/cue/testdata/resolve/025_definitions.txtar
+++ b/cue/testdata/resolve/025_definitions.txtar
@@ -119,7 +119,8 @@
}
-- out/eval --
Errors:
-field `feild` not allowed
+foo: field `feild` not allowed
+foo1.recursive: field `feild` not allowed
Result:
(_|_){
@@ -135,7 +136,7 @@
field2: (string){ string }
}
foo: (_|_){
- // [eval] field `feild` not allowed
+ // [eval] foo: field `feild` not allowed
field: (int){ int }
recursive: (#struct){
field: (string){ string }
@@ -146,7 +147,7 @@
// [eval]
field: (int){ 2 }
recursive: (_|_){
- // [eval] field `feild` not allowed
+ // [eval] foo1.recursive: field `feild` not allowed
field: (string){ string }
feild: (int){ 2 }
}
diff --git a/cue/testdata/resolve/029_non-closed_definition_carries_over_closedness_to_enclosed_template.txtar b/cue/testdata/resolve/029_non-closed_definition_carries_over_closedness_to_enclosed_template.txtar
index 3acc290..09f65bf 100644
--- a/cue/testdata/resolve/029_non-closed_definition_carries_over_closedness_to_enclosed_template.txtar
+++ b/cue/testdata/resolve/029_non-closed_definition_carries_over_closedness_to_enclosed_template.txtar
@@ -104,9 +104,9 @@
}
-- out/eval --
Errors:
-field `b` not allowed
-field `c` not allowed
-field `d` not allowed
+a.v: field `b` not allowed
+b.w: field `c` not allowed
+c.w.0: field `d` not allowed
Result:
(_|_){
@@ -116,7 +116,7 @@
a: (_|_){
// [eval]
v: (_|_){
- // [eval] field `b` not allowed
+ // [eval] a.v: field `b` not allowed
b: (int){ int }
a: (int){ int }
}
@@ -126,7 +126,7 @@
b: (_|_){
// [eval]
w: (_|_){
- // [eval] field `c` not allowed
+ // [eval] b.w: field `c` not allowed
c: (int){ int }
b: (int){ int }
}
@@ -138,7 +138,7 @@
w: (_|_){
// [eval]
0: (_|_){
- // [eval] field `d` not allowed
+ // [eval] c.w.0: field `d` not allowed
d: (int){ int }
a: (int){ int }
}
diff --git a/cue/testdata/resolve/030_definitions_with_disjunctions.txtar b/cue/testdata/resolve/030_definitions_with_disjunctions.txtar
index 709e0ed..84774b6 100644
--- a/cue/testdata/resolve/030_definitions_with_disjunctions.txtar
+++ b/cue/testdata/resolve/030_definitions_with_disjunctions.txtar
@@ -61,7 +61,7 @@
}
-- out/eval --
Errors:
-field `c` not allowed
+bar: field `c` not allowed
Result:
(_|_){
@@ -78,7 +78,7 @@
a: (int){ 1 }
}
bar: (_|_){
- // [eval] field `c` not allowed
+ // [eval] bar: field `c` not allowed
field: (int){ int }
c: (int){ 2 }
b: (int){ 2 }
diff --git a/cue/testdata/resolve/035_excluded_embedding_from_closing.txtar b/cue/testdata/resolve/035_excluded_embedding_from_closing.txtar
index 57ac0de..4aa95d6 100644
--- a/cue/testdata/resolve/035_excluded_embedding_from_closing.txtar
+++ b/cue/testdata/resolve/035_excluded_embedding_from_closing.txtar
@@ -64,8 +64,8 @@
}
-- out/eval --
Errors:
-field `e` not allowed
-field `extra` not allowed
+V.b: field `extra` not allowed
+V.c: field `e` not allowed
Result:
(_|_){
@@ -84,7 +84,7 @@
V: (_|_){
// [eval]
c: (_|_){
- // [eval] field `e` not allowed
+ // [eval] V.c: field `e` not allowed
d: (int){ int }
e: (int){ int }
}
@@ -92,7 +92,7 @@
c: (int){ int }
}
b: (_|_){
- // [eval] field `extra` not allowed
+ // [eval] V.b: field `extra` not allowed
open: (int){ int }
extra: (int){ int }
}
diff --git a/cue/testdata/resolve/038_incomplete_comprehensions.txtar b/cue/testdata/resolve/038_incomplete_comprehensions.txtar
index 5f07859..0da5579 100644
--- a/cue/testdata/resolve/038_incomplete_comprehensions.txtar
+++ b/cue/testdata/resolve/038_incomplete_comprehensions.txtar
@@ -50,7 +50,7 @@
-- out/eval --
(struct){
A: (_|_){
- // [incomplete] incomplete feed source value src (type _):
+ // [incomplete] A: incomplete feed source value src (type _):
// ./in.cue:2:11
src: (_){ _ }
baz: (string){ "baz" }
diff --git a/cue/testdata/resolve/039_reference_to_root.txtar b/cue/testdata/resolve/039_reference_to_root.txtar
index 451d91c..7736c0f 100644
--- a/cue/testdata/resolve/039_reference_to_root.txtar
+++ b/cue/testdata/resolve/039_reference_to_root.txtar
@@ -85,14 +85,14 @@
c: (struct){
b: (int){ 100 }
d: (_|_){
- // [incomplete] non-concrete value int in operand to +:
+ // [incomplete] c.d: non-concrete value int in operand to +:
// ./in.cue:4:5
}
}
x: (struct){
b: (int){ int }
c: (_|_){
- // [incomplete] non-concrete value int in operand to +:
+ // [incomplete] x.c: non-concrete value int in operand to +:
// ./in.cue:8:5
}
}
@@ -103,21 +103,21 @@
v: (struct){
b: (int){ int }
c: (_|_){
- // [incomplete] non-concrete value int in operand to +:
+ // [incomplete] v.c: non-concrete value int in operand to +:
// ./in.cue:16:5
}
}
w: (struct){
b: (int){ 100 }
c: (_|_){
- // [incomplete] non-concrete value int in operand to +:
+ // [incomplete] w.c: non-concrete value int in operand to +:
// ./in.cue:16:5
}
}
wp: (struct){
b: (int){ 100 }
c: (_|_){
- // [incomplete] non-concrete value int in operand to +:
+ // [incomplete] wp.c: non-concrete value int in operand to +:
// ./in.cue:16:5
}
}
diff --git a/cue/testdata/resolve/045_range_unification.txtar b/cue/testdata/resolve/045_range_unification.txtar
index 28c3b71..0b321cb 100644
--- a/cue/testdata/resolve/045_range_unification.txtar
+++ b/cue/testdata/resolve/045_range_unification.txtar
@@ -134,13 +134,20 @@
}
-- out/eval --
Errors:
-bounds >=1.1 <=1.3
-bounds >=6 <=5
-invalid value 0 (out of bound >=1)
-invalid value 6 (out of bound <=5)
-invalid value <=5 (mismatched types number and string)
-invalid value >=1 (mismatched types number and string)
-invalid value string (mismatched types string and number)
+b14: incompatible bounds >=6 and <=5
+b7: incompatible bounds >=6 and <=5
+c3: invalid value <=5 (mismatched types number and string)
+c3: invalid value >=1 (mismatched types number and string)
+c4: invalid value string (mismatched types string and number)
+n2: incompatible bounds >=1.1 and <=1.3
+a4: invalid value 6 (out of bound <=5):
+ ./in.cue:5:11
+a5: invalid value 0 (out of bound >=1):
+ ./in.cue:6:5
+a9: invalid value 6 (out of bound <=5):
+ ./in.cue:11:16
+a10: invalid value 0 (out of bound >=1):
+ ./in.cue:12:10
Result:
(_|_){
@@ -149,19 +156,23 @@
a2: (int){ 1 }
a3: (int){ 5 }
a4: (_|_){
- // [eval] invalid value 6 (out of bound <=5)
+ // [eval] a4: invalid value 6 (out of bound <=5):
+ // ./in.cue:5:11
}
a5: (_|_){
- // [eval] invalid value 0 (out of bound >=1)
+ // [eval] a5: invalid value 0 (out of bound >=1):
+ // ./in.cue:6:5
}
a6: (int){ 3 }
a7: (int){ 1 }
a8: (int){ 5 }
a9: (_|_){
- // [eval] invalid value 6 (out of bound <=5)
+ // [eval] a9: invalid value 6 (out of bound <=5):
+ // ./in.cue:11:16
}
a10: (_|_){
- // [eval] invalid value 0 (out of bound >=1)
+ // [eval] a10: invalid value 0 (out of bound >=1):
+ // ./in.cue:12:10
}
b1: (number){ &(>=1, <=5) }
b2: (number){ 1 }
@@ -170,7 +181,7 @@
b5: (number){ &(>=3, <=5) }
b6: (number){ 5 }
b7: (_|_){
- // [eval] bounds >=6 <=5
+ // [eval] b7: incompatible bounds >=6 and <=5
}
b8: (number){ &(>=1, <=5) }
b9: (number){ 1 }
@@ -179,22 +190,22 @@
b12: (number){ &(>=3, <=5) }
b13: (number){ 5 }
b14: (_|_){
- // [eval] bounds >=6 <=5
+ // [eval] b14: incompatible bounds >=6 and <=5
}
c1: (int){ &(>=1, <=5, int) }
c2: (int){ &(>=1, <=5, int) }
c3: (_|_){
- // [eval] invalid value <=5 (mismatched types number and string)
- // invalid value >=1 (mismatched types number and string)
+ // [eval] c3: invalid value <=5 (mismatched types number and string)
+ // c3: invalid value >=1 (mismatched types number and string)
}
c4: (_|_){
- // [eval] invalid value string (mismatched types string and number)
+ // [eval] c4: invalid value string (mismatched types string and number)
}
s1: (string){ "e" }
s2: (string){ "ee" }
n1: (number){ &(>=1, <=2) }
n2: (_|_){
- // [eval] bounds >=1.1 <=1.3
+ // [eval] n2: incompatible bounds >=1.1 and <=1.3
}
n3: (int){ 2 }
n4: (float){ 0.09999 }
diff --git a/cue/testdata/resolve/046_predefined_ranges.txtar b/cue/testdata/resolve/046_predefined_ranges.txtar
index 784a9f4..33d556c 100644
--- a/cue/testdata/resolve/046_predefined_ranges.txtar
+++ b/cue/testdata/resolve/046_predefined_ranges.txtar
@@ -29,7 +29,7 @@
}
-- out/eval --
Errors:
-invalid value 100000 (out of bound <=32767)
+e1: invalid value 100000 (out of bound <=32767)
Result:
(_|_){
@@ -37,6 +37,6 @@
k1: (int){ 44 }
k2: (int){ -8000000000 }
e1: (_|_){
- // [eval] invalid value 100000 (out of bound <=32767)
+ // [eval] e1: invalid value 100000 (out of bound <=32767)
}
}
diff --git a/cue/testdata/resolve/048_builtins.txtar b/cue/testdata/resolve/048_builtins.txtar
index 4007367..4a24b24 100644
--- a/cue/testdata/resolve/048_builtins.txtar
+++ b/cue/testdata/resolve/048_builtins.txtar
@@ -46,8 +46,10 @@
<0>{a1: <1>{a: (=~"oo" & =~"fo"), b: =~"oo", c: =~"fo"}, a2: <2>{a: "foo", b: =~"oo", c: =~"fo"}, a3: <3>{a: _|_((=~"oo" & "bar"):invalid value "bar" (does not match =~"oo")), b: =~"oo", c: =~"fo"}, o1: <4>{a: string, b: string, c: "bar"}, o2: <5>{a: "foo", b: string, c: "bar"}, o3: <6>{a: _|_(("baz" & "foo"):empty disjunction: conflicting values "baz" and "foo";("bar" & "foo"):empty disjunction: conflicting values "bar" and "foo"), b: "baz", c: "bar"}}
-- out/eval --
Errors:
-invalid value "bar" (out of bound =~"fo")
-invalid value "bar" (out of bound =~"oo")
+a3.a: invalid value "bar" (out of bound =~"oo"):
+ ./in.cue:3:5
+a3.a: invalid value "bar" (out of bound =~"fo"):
+ ./in.cue:4:5
Result:
(_|_){
@@ -65,8 +67,10 @@
a3: (_|_){
// [eval]
a: (_|_){
- // [eval] invalid value "bar" (out of bound =~"fo")
- // invalid value "bar" (out of bound =~"oo")
+ // [eval] a3.a: invalid value "bar" (out of bound =~"oo"):
+ // ./in.cue:3:5
+ // a3.a: invalid value "bar" (out of bound =~"fo"):
+ // ./in.cue:4:5
}
b: (string){ =~"oo" }
c: (string){ =~"fo" }
@@ -83,7 +87,7 @@
}
o3: (struct){
a: (_|_){
- // [incomplete] empty disjunction
+ // [incomplete] o3.a: empty disjunction
}
b: (string){ "baz" }
c: (string){ "bar" }
diff --git a/internal/core/adt/binop.go b/internal/core/adt/binop.go
index 2fb3205..7edd191 100644
--- a/internal/core/adt/binop.go
+++ b/internal/core/adt/binop.go
@@ -19,7 +19,6 @@
"math/big"
"strings"
- "cuelang.org/go/cue/errors"
"github.com/cockroachdb/apd/v2"
)
@@ -42,13 +41,13 @@
if left.Concreteness() > Concrete {
return &Bottom{
Code: IncompleteError,
- Err: errors.Newf(c.pos(), msg, c.Str(left), op),
+ Err: c.Newf(msg, c.Str(left), op),
}
}
if right.Concreteness() > Concrete {
return &Bottom{
Code: IncompleteError,
- Err: errors.Newf(c.pos(), msg, c.Str(right), op),
+ Err: c.Newf(msg, c.Str(right), op),
}
}
diff --git a/internal/core/adt/context.go b/internal/core/adt/context.go
index 19955ec..f54fd72 100644
--- a/internal/core/adt/context.go
+++ b/internal/core/adt/context.go
@@ -93,6 +93,7 @@
}
ctx := &OpContext{
config: *cfg,
+ vertex: v,
}
if v != nil {
ctx.e = &Environment{Up: nil, Vertex: v}
@@ -110,6 +111,11 @@
src ast.Node
errs *Bottom
+ // vertex is used to determine the path location in case of error. Turning
+ // this into a stack could also allow determining the cyclic path for
+ // structural cycle errors.
+ vertex *Vertex
+
// TODO: remove use of tentative. Should be possible if incomplete
// handling is done better.
tentative int // set during comprehension evaluation
@@ -219,7 +225,7 @@
}
}
- err := errors.Newf(pos, msg, args...)
+ err := c.NewPosf(pos, msg, args...)
c.addErr(code, err)
}
@@ -243,13 +249,15 @@
// NewErrf creates a *Bottom value and returns it. The returned uses the
// current source as the point of origin of the error.
func (c *OpContext) NewErrf(format string, args ...interface{}) *Bottom {
- err := errors.Newf(c.pos(), format, args...)
+ // TODO: consider renaming ot NewBottomf: this is now confusing as we also
+ // have Newf.
+ err := c.Newf(format, args...)
return &Bottom{Src: c.src, Err: err, Code: EvalError}
}
// AddErrf records an error in OpContext. It returns errors collected so far.
func (c *OpContext) AddErrf(format string, args ...interface{}) *Bottom {
- return c.AddErr(errors.Newf(c.pos(), format, args...))
+ return c.AddErr(c.Newf(format, args...))
}
func (c *OpContext) validate(v Value) *Bottom {
@@ -295,6 +303,19 @@
return err
}
+// PushArc signals c that arc v is currently being processed for the purpose
+// of error reporting. PopArc should be called with the returned value once
+// processing of v is completed.
+func (c *OpContext) PushArc(v *Vertex) (saved *Vertex) {
+ c.vertex, saved = v, c.vertex
+ return saved
+}
+
+// PopArc signals completion of processing the current arc.
+func (c *OpContext) PopArc(saved *Vertex) {
+ c.vertex = saved
+}
+
// Resolve finds a node in the tree.
//
// Should only be used to insert Conjuncts. TODO: perhaps only return Conjuncts
@@ -315,7 +336,15 @@
// Validate calls validates value for the given validator.
func (c *OpContext) Validate(check Validator, value Value) *Bottom {
- return check.validate(c, value)
+ // TODO: use a position stack to push both values.
+ saved := c.src
+ c.src = check.Source()
+
+ err := check.validate(c, value)
+
+ c.src = saved
+
+ return err
}
// Yield evaluates a Yielder and calls f for each result.
@@ -404,7 +433,7 @@
// TODO ENSURE THIS DOESN"T HAPPEN>
val = &Bottom{
Code: IncompleteError,
- Err: errors.Newf(token.NoPos, "UNANTICIPATED ERROR"),
+ Err: c.Newf("UNANTICIPATED ERROR"),
}
}
diff --git a/internal/core/adt/errors.go b/internal/core/adt/errors.go
index ecfe359..ec73924 100644
--- a/internal/core/adt/errors.go
+++ b/internal/core/adt/errors.go
@@ -34,6 +34,7 @@
import (
"cuelang.org/go/cue/ast"
"cuelang.org/go/cue/errors"
+ "cuelang.org/go/cue/token"
)
// ErrorCode indicates the type of error. The type of error may influence
@@ -199,3 +200,53 @@
Code: a.Code,
}
}
+
+// A valueError is returned as a result of evaluating a value.
+type valueError struct {
+ r Runtime
+ v *Vertex
+ pos []token.Pos
+ errors.Message
+}
+
+func (c *OpContext) errNode() *Vertex {
+ return c.vertex
+}
+
+func (c *OpContext) Newf(format string, args ...interface{}) *valueError {
+ return c.NewPosf(c.pos(), format, args...)
+}
+
+func (c *OpContext) NewPosf(pos token.Pos, format string, args ...interface{}) *valueError {
+ return &valueError{
+ r: c.Runtime,
+ v: c.errNode(),
+ // TODO: leave ni if it can be derived from the source and save an
+ // allocation.
+ pos: []token.Pos{pos},
+ Message: errors.NewMessage(format, args),
+ }
+}
+
+func (e *valueError) Error() string {
+ return errors.String(e)
+}
+
+func (e *valueError) Position() token.Pos {
+ if len(e.pos) == 0 {
+ // TODO: retrieve from source
+ return token.NoPos
+ }
+ return e.pos[0]
+}
+
+func (e *valueError) InputPositions() []token.Pos {
+ return e.pos
+}
+
+func (e *valueError) Path() (a []string) {
+ for _, f := range appendPath(nil, e.v) {
+ a = append(a, f.SelectorString(e.r))
+ }
+ return a
+}
diff --git a/internal/core/adt/simplify.go b/internal/core/adt/simplify.go
index aa3eb58..cc35653 100644
--- a/internal/core/adt/simplify.go
+++ b/internal/core/adt/simplify.go
@@ -151,7 +151,7 @@
fallthrough
case d.Negative:
- return ctx.NewErrf("bounds %v %v", ctx.Str(x), ctx.Str(y))
+ return ctx.NewErrf("incompatible bounds %v and %v", ctx.Str(x), ctx.Str(y))
}
case x.Op == NotEqualOp:
diff --git a/internal/core/convert/go.go b/internal/core/convert/go.go
index f84ff9f..36cf236 100644
--- a/internal/core/convert/go.go
+++ b/internal/core/convert/go.go
@@ -305,7 +305,7 @@
case errors.Error:
errs = x
default:
- errs = errors.Newf(token.NoPos, "%s", x.Error())
+ errs = ctx.Newf("%s", x.Error())
}
return &adt.Bottom{Err: errs}
case bool:
diff --git a/internal/core/eval/closed.go b/internal/core/eval/closed.go
index b2201fd..80f6ed8 100644
--- a/internal/core/eval/closed.go
+++ b/internal/core/eval/closed.go
@@ -42,8 +42,6 @@
// in eval.go.
import (
- "cuelang.org/go/cue/errors"
- "cuelang.org/go/cue/token"
"cuelang.org/go/internal/core/adt"
)
@@ -320,9 +318,7 @@
filter := f.IsString() || f == adt.InvalidLabel
if filter && !n.verifyArcRecursive(ctx, n.tree, f) {
label := f.SelectorString(ctx)
- return &adt.Bottom{
- Err: errors.Newf(token.NoPos, "field `%s` not allowed", label),
- }
+ return ctx.NewErrf("field `%s` not allowed", label)
}
return nil
}
diff --git a/internal/core/eval/disjunct.go b/internal/core/eval/disjunct.go
index db5df3c..973afcc 100644
--- a/internal/core/eval/disjunct.go
+++ b/internal/core/eval/disjunct.go
@@ -17,8 +17,6 @@
import (
"sort"
- "cuelang.org/go/cue/errors"
- "cuelang.org/go/cue/token"
"cuelang.org/go/internal/core/adt"
)
@@ -214,7 +212,7 @@
// really we should keep track of the errors and return a more
// accurate result here.
Code: adt.IncompleteError,
- Err: errors.Newf(token.NoPos, "empty disjunction"),
+ Err: n.ctx.Newf("empty disjunction"),
}
n.node.AddErr(n.ctx, b)
}
diff --git a/internal/core/eval/eval.go b/internal/core/eval/eval.go
index 591e179..a6444c7 100644
--- a/internal/core/eval/eval.go
+++ b/internal/core/eval/eval.go
@@ -325,6 +325,8 @@
}
saved := *v
+ defer c.PopArc(c.PushArc(v))
+
e.stats.UnifyCount++
for i := 0; ; i++ {
e.stats.DisjunctCount++
@@ -474,10 +476,8 @@
markStruct := false
if n.isStruct {
if kind != 0 && kind&adt.StructKind == 0 {
- n.node.Value = &adt.Bottom{
- Err: errors.Newf(token.NoPos,
- "conflicting values struct and %s", n.kind),
- }
+ n.node.Value = n.ctx.NewErrf(
+ "conflicting values struct and %s", n.kind)
}
markStruct = true
} else if len(n.node.Structs) > 0 {
@@ -497,9 +497,10 @@
if src := v.Source(); src != nil {
p = src.Pos()
}
- n.addErr(errors.Newf(p,
- // TODO(err): position of all value types.
- "conflicting types",
+ n.addErr(ctx.NewPosf(p,
+ // TODO(errors): position of all value types.
+ "conflicting types %v and %v",
+ v.Kind(), n.kind,
))
}
if n.lowerBound != nil {
@@ -533,9 +534,9 @@
case v.Kind() == adt.ListKind:
for _, a := range n.node.Arcs {
if a.Label.Typ() == adt.StringLabel {
- n.addErr(errors.Newf(token.NoPos,
- // TODO(err): add positions for list and arc definitions.
- "list may not have regular fields"))
+ n.addErr(ctx.Newf("list may not have regular fields"))
+ // TODO(errors): add positions for list and arc definitions.
+
}
}
@@ -543,7 +544,7 @@
// for _, a := range n.node.Arcs {
// if a.Label.IsRegular() {
// n.addErr(errors.Newf(token.NoPos,
- // // TODO(err): add positions of non-struct values and arcs.
+ // // TODO(errors): add positions of non-struct values and arcs.
// "cannot combine scalar values with arcs"))
// }
// }
@@ -594,9 +595,8 @@
if accept := n.nodeShared.accept; accept != nil {
if !accept.Accept(n.ctx, a.Label) {
label := a.Label.SelectorString(ctx)
- n.node.Value = &adt.Bottom{
- Err: errors.Newf(token.NoPos, "field `%s` not allowed by Acceptor", label),
- }
+ n.node.Value = ctx.NewErrf(
+ "field `%s` not allowed by Acceptor", label)
}
} else if err := m.verifyArcAllowed(n.ctx, a.Label); err != nil {
n.node.Value = err
@@ -619,7 +619,7 @@
if cyclic {
n.node.Value = adt.CombineErrors(nil, n.node.Value, &adt.Bottom{
Code: adt.StructuralCycleError,
- Err: errors.Newf(token.NoPos, "structural cycle"),
+ Err: ctx.Newf("structural cycle"),
Value: n.node.Value,
// TODO: probably, this should have the referenced arc.
})
@@ -1190,7 +1190,7 @@
kind := n.kind & v.Kind()
if kind == adt.BottomKind {
// TODO: how to get other conflicting values?
- n.addErr(errors.Newf(token.NoPos,
+ n.addErr(ctx.Newf(
"invalid value %s (mismatched types %s and %s)",
ctx.Str(v), v.Kind(), n.kind))
return
@@ -1245,7 +1245,7 @@
case adt.Value: // *NullLit, *BoolLit, *NumLit, *StringLit, *BytesLit
if y := n.scalar; y != nil {
if b, ok := adt.BinOp(ctx, adt.EqualOp, x, y).(*adt.Bool); !ok || !b.B {
- n.addErr(errors.Newf(ctx.Pos(), "incompatible values %s and %s", ctx.Str(x), ctx.Str(y)))
+ n.addErr(ctx.Newf("incompatible values %s and %s", ctx.Str(x), ctx.Str(y)))
}
// TODO: do we need to explicitly add again?
// n.scalar = nil
@@ -1372,7 +1372,7 @@
}
if hasBulk != nil && hasOther != nil {
- n.addErr(errors.Newf(token.NoPos, "cannot mix bulk optional fields with dynamic fields, embeddings, or comprehensions within the same struct"))
+ n.addErr(ctx.Newf("cannot mix bulk optional fields with dynamic fields, embeddings, or comprehensions within the same struct"))
}
// Apply existing fields
@@ -1421,7 +1421,7 @@
// processed. We could instead detect such insertion and feed it to the
// ForClause to generate another entry or have the for clause be recomputed.
// This seems to be too complicated and lead to iffy edge cases.
-// TODO(error): detect when a field is added to a struct that is already used
+// TODO(errors): detect when a field is added to a struct that is already used
// in a for clause.
func (n *nodeContext) expandOne() (done bool) {
if n.done() {
@@ -1548,7 +1548,7 @@
for _, a := range n.node.Arcs {
if t := a.Label.Typ(); t == adt.StringLabel {
- n.addErr(errors.Newf(token.NoPos, "conflicting types list and struct"))
+ n.addErr(c.Newf("conflicting types list and struct"))
}
}
@@ -1616,8 +1616,7 @@
case *adt.Ellipsis:
if j != len(l.list.Elems)-1 {
- n.addErr(errors.Newf(token.NoPos,
- "ellipsis must be last element in list"))
+ n.addErr(c.Newf("ellipsis must be last element in list"))
}
n.lists[i].elipsis = x
@@ -1709,6 +1708,5 @@
}
func (n *nodeContext) invalidListLength(na, nb int, a, b adt.Expr) {
- n.addErr(errors.Newf(n.ctx.Pos(),
- "incompatible list lengths (%d and %d)", na, nb))
+ n.addErr(n.ctx.Newf("incompatible list lengths (%d and %d)", na, nb))
}
diff --git a/internal/core/eval/eval_test.go b/internal/core/eval/eval_test.go
index 96197b1..68eb20f 100644
--- a/internal/core/eval/eval_test.go
+++ b/internal/core/eval/eval_test.go
@@ -62,7 +62,7 @@
t.Log(e.Stats())
- if b := validate.Validate(r, v, &validate.Config{
+ if b := validate.Validate(ctx, v, &validate.Config{
AllErrors: true,
}); b != nil {
fmt.Fprintln(t, "Errors:")
diff --git a/internal/core/export/testdata/adt.txtar b/internal/core/export/testdata/adt.txtar
index aaabe3f..49e7fbc 100644
--- a/internal/core/export/testdata/adt.txtar
+++ b/internal/core/export/testdata/adt.txtar
@@ -191,8 +191,8 @@
[x]
-- out/value --
== Simplified
-_|_ // undefined field 2
+_|_ // e3: undefined field 2
== Raw
-_|_ // undefined field 2
+_|_ // e3: undefined field 2
== All
-_|_ // undefined field 2
+_|_ // e3: undefined field 2
diff --git a/internal/core/validate/validate.go b/internal/core/validate/validate.go
index 2f20f82..ecf85fb 100644
--- a/internal/core/validate/validate.go
+++ b/internal/core/validate/validate.go
@@ -12,13 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.
+// Package validate collects errors from an evaluated Vertex.
package validate
import (
- "cuelang.org/go/cue/errors"
- "cuelang.org/go/cue/token"
"cuelang.org/go/internal/core/adt"
- "cuelang.org/go/internal/core/debug"
)
type Config struct {
@@ -36,20 +34,20 @@
// Validate checks that a value has certain properties. The value must have
// been evaluated.
-func Validate(r adt.Runtime, v *adt.Vertex, cfg *Config) *adt.Bottom {
+func Validate(ctx *adt.OpContext, v *adt.Vertex, cfg *Config) *adt.Bottom {
if cfg == nil {
cfg = &Config{}
}
- x := validator{Config: *cfg, runtime: r}
+ x := validator{Config: *cfg, ctx: ctx}
x.validate(v)
return x.err
}
type validator struct {
Config
+ ctx *adt.OpContext
err *adt.Bottom
inDefinition int
- runtime adt.Runtime
}
func (v *validator) add(b *adt.Bottom) {
@@ -63,6 +61,8 @@
}
func (v *validator) validate(x *adt.Vertex) {
+ defer v.ctx.PopArc(v.ctx.PushArc(x))
+
if b, _ := x.Value.(*adt.Bottom); b != nil {
switch b.Code {
case adt.CycleError:
@@ -83,15 +83,10 @@
}
} else if v.Concrete && v.inDefinition == 0 && !adt.IsConcrete(x) {
- p := token.NoPos
- if src := x.Value.Source(); src != nil {
- p = src.Pos()
- }
// TODO: use ValueError to get full path.
v.add(&adt.Bottom{
Code: adt.IncompleteError,
- Err: errors.Newf(p, "incomplete value %v",
- debug.NodeString(v.runtime, x.Value, nil)),
+ Err: v.ctx.Newf("incomplete value %v", v.ctx.Str(x.Value)),
})
}
diff --git a/internal/core/validate/validate_test.go b/internal/core/validate/validate_test.go
index ab70286..4813ef5 100644
--- a/internal/core/validate/validate_test.go
+++ b/internal/core/validate/validate_test.go
@@ -42,7 +42,7 @@
#foo: { use: string }
`,
lookup: "#foo",
- out: "incomplete\nincomplete value string",
+ out: "incomplete\n#foo.use: incomplete value string",
}, {
desc: "definitions not considered for completeness",
cfg: &Config{Concrete: true},
@@ -71,14 +71,14 @@
in: `
x: 1 & 2
`,
- out: "eval\nincompatible values 2 and 1",
+ out: "eval\nx: incompatible values 2 and 1",
}, {
desc: "first error",
in: `
x: 1 & 2
y: 2 & 4
`,
- out: "eval\nincompatible values 2 and 1",
+ out: "eval\nx: incompatible values 2 and 1",
}, {
desc: "all errors",
cfg: &Config{AllErrors: true},
@@ -87,8 +87,8 @@
y: 2 & 4
`,
out: `eval
-incompatible values 2 and 1
-incompatible values 4 and 2`,
+x: incompatible values 2 and 1
+y: incompatible values 4 and 2`,
}, {
desc: "incomplete",
cfg: &Config{Concrete: true},
@@ -96,7 +96,7 @@
y: 2 + x
x: string
`,
- out: "incomplete\nnon-concrete value string in operand to +:\n test:2:6",
+ out: "incomplete\ny: non-concrete value string in operand to +:\n test:2:6",
}, {
desc: "allowed incomplete cycle",
in: `
@@ -142,7 +142,7 @@
y: string
x: 1 & 2
`,
- out: "eval\nincompatible values 2 and 1",
+ out: "eval\nx: incompatible values 2 and 1",
}}
r := runtime.New()
@@ -163,7 +163,7 @@
v = v.Lookup(adt.MakeIdentLabel(r, tc.lookup))
}
- b := Validate(r, v, tc.cfg)
+ b := Validate(ctx, v, tc.cfg)
w := &strings.Builder{}
if b != nil {
diff --git a/internal/legacy/cue/builtin.go b/internal/legacy/cue/builtin.go
index cfdba45..9fa9fa1 100644
--- a/internal/legacy/cue/builtin.go
+++ b/internal/legacy/cue/builtin.go
@@ -210,8 +210,7 @@
}
c.ret = len(s)
default:
- c.ret = errors.Newf(token.NoPos,
- "invalid argument type %v", k)
+ c.ret = c.ctx.opCtx.Newf("invalid argument type %v", k)
}
},
}
diff --git a/internal/legacy/cue/builtin_test.go b/internal/legacy/cue/builtin_test.go
index 21ac694..1170035 100644
--- a/internal/legacy/cue/builtin_test.go
+++ b/internal/legacy/cue/builtin_test.go
@@ -112,19 +112,19 @@
`true`,
}, {
test("encoding/json", `json.Validate("{\"a\":10}", {a:<3})`),
- `_|_(error in call to encoding/json.Validate: invalid value 10 (out of bound <3) (and 1 more errors))`,
+ `_|_(error in call to encoding/json.Validate: a: invalid value 10 (out of bound <3) (and 1 more errors))`,
}, {
test("encoding/yaml", `yaml.Validate("a: 2\n---\na: 4", {a:<3})`),
- `_|_(error in call to encoding/yaml.Validate: invalid value 4 (out of bound <3) (and 1 more errors))`,
+ `_|_(error in call to encoding/yaml.Validate: a: invalid value 4 (out of bound <3) (and 1 more errors))`,
}, {
test("encoding/yaml", `yaml.Validate("a: 2\n---\na: 4", {a:<5})`),
`true`,
}, {
test("encoding/yaml", `yaml.Validate("a: 2\n", {a:<5, b:int})`),
- `_|_(error in call to encoding/yaml.Validate: incomplete value int (and 1 more errors))`,
+ `_|_(error in call to encoding/yaml.Validate: b: incomplete value int (and 1 more errors))`,
}, {
test("encoding/yaml", `yaml.ValidatePartial("a: 2\n---\na: 4", {a:<3})`),
- `_|_(error in call to encoding/yaml.ValidatePartial: invalid value 4 (out of bound <3) (and 1 more errors))`,
+ `_|_(error in call to encoding/yaml.ValidatePartial: a: invalid value 4 (out of bound <3) (and 1 more errors))`,
}, {
test("encoding/yaml", `yaml.ValidatePartial("a: 2\n---\na: 4", {a:<5})`),
`true`,
@@ -269,11 +269,12 @@
`[{a:1,v:2},{a:1,v:3},{a:2,v:1}]`,
}, {
test("list", `list.Sort([{a:1}, {b:2}], list.Ascending)`),
- `_|_(error in call to list.Sort: invalid operands {b:2} and {a:1} to '<' (type struct and struct) (and 1 more errors))`,
+ `_|_(error in call to list.Sort: less: invalid operands {b:2} and {a:1} to '<' (type struct and struct) (and 1 more errors))`,
}, {
test("list", `list.SortStrings(["b", "a"])`),
`["a","b"]`,
}, {
+ // TODO: path error. This should be done as part of builtin refactoring.
test("list", `list.SortStrings([1, 2])`),
`_|_(error in call to list.SortStrings: element 0 of list argument 0: 0: cannot use value 1 (type int) as string (and 1 more errors))`,
}, {
@@ -694,7 +695,7 @@
emit string
}{{
test("list", `list.Sort([{a:1}, {b:2}], list.Ascending)`),
- `_|_(error in call to list.Sort: invalid operands {b:2} and {a:1} to '<' (type struct and struct) (and 1 more errors))`,
+ `_|_(error in call to list.Sort: less: invalid operands {b:2} and {a:1} to '<' (type struct and struct) (and 1 more errors))`,
}}
for i, tc := range testCases {
t.Run(fmt.Sprint(i), func(t *testing.T) {
diff --git a/internal/legacy/cue/types.go b/internal/legacy/cue/types.go
index 37f5f62..1e1ced5 100644
--- a/internal/legacy/cue/types.go
+++ b/internal/legacy/cue/types.go
@@ -1906,7 +1906,7 @@
AllErrors: true,
}
- b := validate.Validate(v.idx.Runtime, v.v, cfg)
+ b := validate.Validate(v.ctx().opCtx, v.v, cfg)
if b != nil {
return b.Err
}