Skip to content

Commit

Permalink
internal/core/adt: improve error message
Browse files Browse the repository at this point in the history
- Don't use backticks (not used elsewhere)
- fix typo

Change-Id: I825f629c32003287c5d67a0ac63106f0e9e385d5
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/9064
Reviewed-by: CUE cueckoo <cueckoo@gmail.com>
Reviewed-by: Paul Jolly <paul@myitcv.org.uk>
  • Loading branch information
mpvl committed Mar 21, 2021
1 parent 1f9300d commit 2a937a9
Show file tree
Hide file tree
Showing 29 changed files with 90 additions and 90 deletions.
4 changes: 2 additions & 2 deletions cmd/cue/cmd/testdata/script/vet_embed.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ a: 1
e: 2

-- expect-foo --
field `c` not allowed
field c not allowed
-- expect-stream --
field `d` not allowed
field d not allowed
4 changes: 2 additions & 2 deletions cue/testdata/builtins/closed.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ withSubfields: {

-- out/eval --
Errors:
b: field `x` not allowed:
b: field x not allowed:
./in.cue:1:10
./in.cue:5:4
./in.cue:5:10
Expand All @@ -63,7 +63,7 @@ Result:
b: (int){ int }
}
x: (_|_){
// [eval] b: field `x` not allowed:
// [eval] b: field x not allowed:
// ./in.cue:1:10
// ./in.cue:5:4
// ./in.cue:5:10
Expand Down
4 changes: 2 additions & 2 deletions cue/testdata/builtins/issue490.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ B: A & {
}
-- out/eval --
Errors:
B: field `c` not allowed:
B: field c not allowed:
./test.cue:1:10
./test.cue:6:4
./test.cue:7:2
Expand All @@ -26,7 +26,7 @@ Result:
a: (int){ 1 }
b: (int){ 2 }
c: (_|_){
// [eval] B: field `c` not allowed:
// [eval] B: field c not allowed:
// ./test.cue:1:10
// ./test.cue:6:4
// ./test.cue:7:2
Expand Down
4 changes: 2 additions & 2 deletions cue/testdata/comprehensions/issue293.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ t: #C
t: p: "foo"
-- out/eval --
Errors:
z.x: field `f2` not allowed:
z.x: field f2 not allowed:
./in.cue:2:2
./in.cue:5:12
./in.cue:11:4
Expand All @@ -46,7 +46,7 @@ Result:
// [eval]
f1: (int){ 99 }
f2: (_|_){
// [eval] z.x: field `f2` not allowed:
// [eval] z.x: field f2 not allowed:
// ./in.cue:2:2
// ./in.cue:5:12
// ./in.cue:11:4
Expand Down
8 changes: 4 additions & 4 deletions cue/testdata/definitions/026_combined_definitions.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,11 @@ d1: #D1 & {
}
-- out/eval --
Errors:
#D4.env: field `b` not allowed:
#D4.env: field b not allowed:
./in.cue:26:7
./in.cue:27:7
./in.cue:30:6
d1.env: field `c` not allowed:
d1.env: field c not allowed:
./in.cue:3:7
./in.cue:4:7
./in.cue:9:5
Expand All @@ -148,7 +148,7 @@ Result:
a: (string){ "A" }
b: (string){ "B" }
c: (_|_){
// [eval] d1.env: field `c` not allowed:
// [eval] d1.env: field c not allowed:
// ./in.cue:3:7
// ./in.cue:4:7
// ./in.cue:9:5
Expand Down Expand Up @@ -176,7 +176,7 @@ Result:
// [eval]
a: (int){ int }
b: (_|_){
// [eval] #D4.env: field `b` not allowed:
// [eval] #D4.env: field b not allowed:
// ./in.cue:26:7
// ./in.cue:27:7
// ./in.cue:30:6
Expand Down
4 changes: 2 additions & 2 deletions cue/testdata/definitions/032_definitions_with_embedding.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
}
-- out/eval --
Errors:
#e1.a: field `d` not allowed:
#e1.a: field d not allowed:
./in.cue:2:5
./in.cue:6:2
./in.cue:7:5
Expand Down Expand Up @@ -110,7 +110,7 @@ Result:
b: (int){ int }
c: (int){ int }
d: (_|_){
// [eval] #e1.a: field `d` not allowed:
// [eval] #e1.a: field d not allowed:
// ./in.cue:2:5
// ./in.cue:6:2
// ./in.cue:7:5
Expand Down
4 changes: 2 additions & 2 deletions cue/testdata/definitions/033_Issue_#153.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Junk: {
}
-- out/eval --
Errors:
listOfCloseds.0: field `b` not allowed:
listOfCloseds.0: field b not allowed:
./in.cue:2:21
./in.cue:5:10
./in.cue:13:1
Expand All @@ -79,7 +79,7 @@ Result:
// [eval]
a: (int){ |(*(int){ 0 }, (int){ int }) }
b: (_|_){
// [eval] listOfCloseds.0: field `b` not allowed:
// [eval] listOfCloseds.0: field b not allowed:
// ./in.cue:2:21
// ./in.cue:5:10
// ./in.cue:13:1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,13 @@ a: _|_ // field "f3" not allowed in closed struct
}
-- out/eval --
Errors:
#E: field `f3` not allowed:
#E: field f3 not allowed:
./in.cue:1:5
./in.cue:27:5
./in.cue:27:10
./in.cue:28:2
./in.cue:29:3
a: field `f3` not allowed:
a: field f3 not allowed:
./in.cue:1:5
./in.cue:3:1
./in.cue:4:5
Expand All @@ -137,7 +137,7 @@ Result:
f1: (int){ int }
f2: (int){ int }
f3: (_|_){
// [eval] #E: field `f3` not allowed:
// [eval] #E: field f3 not allowed:
// ./in.cue:1:5
// ./in.cue:27:5
// ./in.cue:27:10
Expand All @@ -150,7 +150,7 @@ Result:
f1: (int){ int }
f2: (int){ int }
f3: (_|_){
// [eval] a: field `f3` not allowed:
// [eval] a: field f3 not allowed:
// ./in.cue:1:5
// ./in.cue:3:1
// ./in.cue:4:5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ d: _|_ // field "aaa" not allowed in closed struct
}
-- out/eval --
Errors:
c: field `aaa` not allowed:
c: field aaa not allowed:
./in.cue:2:2
./in.cue:4:5
./in.cue:8:5
./in.cue:8:10
./in.cue:9:5
./in.cue:9:11
d: field `aaa` not allowed:
d: field aaa not allowed:
./in.cue:2:2
./in.cue:4:5
./in.cue:11:5
Expand All @@ -80,7 +80,7 @@ Result:
c: (_|_){
// [eval]
aaa: (_|_){
// [eval] c: field `aaa` not allowed:
// [eval] c: field aaa not allowed:
// ./in.cue:2:2
// ./in.cue:4:5
// ./in.cue:8:5
Expand All @@ -94,7 +94,7 @@ Result:
d: (_|_){
// [eval]
aaa: (_|_){
// [eval] d: field `aaa` not allowed:
// [eval] d: field aaa not allowed:
// ./in.cue:2:2
// ./in.cue:4:5
// ./in.cue:11:5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ a: #S & {
}
-- out/eval --
Errors:
a.v: field `b` not allowed:
a.v: field b not allowed:
./in.cue:2:12
./in.cue:4:4
./in.cue:5:6
Expand All @@ -53,7 +53,7 @@ Result:
v: (_|_){
// [eval]
b: (_|_){
// [eval] a.v: field `b` not allowed:
// [eval] a.v: field b not allowed:
// ./in.cue:2:12
// ./in.cue:4:4
// ./in.cue:5:6
Expand Down
4 changes: 2 additions & 2 deletions cue/testdata/definitions/defembed.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ a: c: 1
#A: b: 1
-- out/eval --
Errors:
a: field `c` not allowed:
a: field c not allowed:
./in.cue:1:4
./in.cue:2:5
./in.cue:5:4
Expand All @@ -21,7 +21,7 @@ Result:
// [eval]
b: (int){ 1 }
c: (_|_){
// [eval] a: field `c` not allowed:
// [eval] a: field c not allowed:
// ./in.cue:1:4
// ./in.cue:2:5
// ./in.cue:5:4
Expand Down
8 changes: 4 additions & 4 deletions cue/testdata/definitions/embed.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ reclose3: {

-- out/eval --
Errors:
reclose1.z: field `d` not allowed:
reclose1.z: field d not allowed:
./in.cue:28:8
./in.cue:33:6
./in.cue:34:6
recloseSimple.a: field `b` not allowed:
recloseSimple.a: field b not allowed:
./in.cue:16:9
./in.cue:17:6
./in.cue:17:7
Expand Down Expand Up @@ -113,7 +113,7 @@ Result:
a: (_|_){
// [eval]
b: (_|_){
// [eval] recloseSimple.a: field `b` not allowed:
// [eval] recloseSimple.a: field b not allowed:
// ./in.cue:16:9
// ./in.cue:17:6
// ./in.cue:17:7
Expand All @@ -138,7 +138,7 @@ Result:
// [eval]
c: (int){ int }
d: (_|_){
// [eval] reclose1.z: field `d` not allowed:
// [eval] reclose1.z: field d not allowed:
// ./in.cue:28:8
// ./in.cue:33:6
// ./in.cue:34:6
Expand Down
4 changes: 2 additions & 2 deletions cue/testdata/definitions/hidden.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ package pkg

-- out/eval --
Errors:
e._name: field `c` not allowed:
e._name: field c not allowed:
./in.cue:6:10
./in.cue:13:13
./in.cue:16:10
Expand Down Expand Up @@ -68,7 +68,7 @@ Result:
// [eval]
d: (int){ int }
c: (_|_){
// [eval] e._name: field `c` not allowed:
// [eval] e._name: field c not allowed:
// ./in.cue:6:10
// ./in.cue:13:13
// ./in.cue:16:10
Expand Down
4 changes: 2 additions & 2 deletions cue/testdata/definitions/issue271.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ x: {
}
-- out/eval --
Errors:
x: field `b` not allowed:
x: field b not allowed:
./in.cue:1:5
./in.cue:2:11
./in.cue:3:4
Expand All @@ -24,7 +24,7 @@ Result:
// [eval]
a: (string){ "hello" }
b: (_|_){
// [eval] x: field `b` not allowed:
// [eval] x: field b not allowed:
// ./in.cue:1:5
// ./in.cue:2:11
// ./in.cue:3:4
Expand Down
4 changes: 2 additions & 2 deletions cue/testdata/definitions/issue320.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ foo: #Foo & {
}
-- out/eval --
Errors:
foo: field `y` not allowed:
foo: field y not allowed:
./in.cue:1:7
./in.cue:3:2
./in.cue:6:8
Expand All @@ -31,7 +31,7 @@ Result:
// [eval]
x: (string){ "hello" }
y: (_|_){
// [eval] foo: field `y` not allowed:
// [eval] foo: field y not allowed:
// ./in.cue:1:7
// ./in.cue:3:2
// ./in.cue:6:8
Expand Down
8 changes: 4 additions & 4 deletions cue/testdata/definitions/issue533.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ x2: _#x & {
}
-- out/eval --
Errors:
x1: field `Age` not allowed:
x1: field Age not allowed:
./in.cue:3:5
./in.cue:11:5
./in.cue:13:2
x2: field `Age` not allowed:
x2: field Age not allowed:
./in.cue:7:6
./in.cue:16:5
./in.cue:18:2
Expand All @@ -42,7 +42,7 @@ Result:
// [eval]
Name: (string){ "hello" }
Age: (_|_){
// [eval] x1: field `Age` not allowed:
// [eval] x1: field Age not allowed:
// ./in.cue:3:5
// ./in.cue:11:5
// ./in.cue:13:2
Expand All @@ -52,7 +52,7 @@ Result:
// [eval]
Name: (string){ "hello" }
Age: (_|_){
// [eval] x2: field `Age` not allowed:
// [eval] x2: field Age not allowed:
// ./in.cue:7:6
// ./in.cue:16:5
// ./in.cue:18:2
Expand Down

0 comments on commit 2a937a9

Please sign in to comment.