diff --git a/cmd/cue/cmd/testdata/script/vet_yaml.txtar b/cmd/cue/cmd/testdata/script/vet_yaml.txtar index e6d294443..a4db2b724 100644 --- a/cmd/cue/cmd/testdata/script/vet_yaml.txtar +++ b/cmd/cue/cmd/testdata/script/vet_yaml.txtar @@ -2,7 +2,7 @@ cmp stderr expect-stderr -- expect-stderr -- -phrases: invalid value "phrases:\n # A quote from Mark Twain.\n quote1:\n lang: en\n attribution: Mark Twain\n\n # A Norwegian proverb.\n proverb:\n lang: no\n text: Stemmen som sier at du ikke klarer det, lyver." (does not satisfy encoding/yaml.Validate): error in call to encoding/yaml.Validate: incomplete value !="": +phrases: invalid value "phrases:\n # A quote from Mark Twain.\n quote1:\n lang: en\n attribution: Mark Twain\n\n # A Norwegian proverb.\n proverb:\n lang: no\n text: Stemmen som sier at du ikke klarer det, lyver." (does not satisfy encoding/yaml.Validate): incomplete value !="": ./yaml.cue:19:10 ./yaml.cue:11:17 ./yaml.cue:21:10 diff --git a/cue/builtin_test.go b/cue/builtin_test.go index 96a600f05..bfed4a813 100644 --- a/cue/builtin_test.go +++ b/cue/builtin_test.go @@ -92,7 +92,7 @@ func TestBuiltins(t *testing.T) { }`), `{ x: int - y: _|_ // cannot convert incomplete value "int" to JSON + y: _|_ // y: error in call to encoding/json.Marshal: cannot convert incomplete value "int" to JSON }`, }, { test("encoding/yaml", `yaml.MarshalStream([{a: 1}, {b: 2}])`), @@ -115,7 +115,7 @@ func TestBuiltins(t *testing.T) { `"1937-01-01T12:00:27.87+00:20"`, }, { test("time", `time.Time & "no time"`), - `_|_ // invalid value "no time" (does not satisfy time.Time): error in call to time.Time: invalid time "no time"`, + `_|_ // invalid value "no time" (does not satisfy time.Time): invalid time "no time"`, }, { test("time", `time.Unix(1500000000, 123456)`), `"2017-07-14T02:40:00.000123456Z"`, diff --git a/cue/testdata/basicrewrite/002_arithmetic.txtar b/cue/testdata/basicrewrite/002_arithmetic.txtar index c45b83d1f..90e41c2dd 100644 --- a/cue/testdata/basicrewrite/002_arithmetic.txtar +++ b/cue/testdata/basicrewrite/002_arithmetic.txtar @@ -76,13 +76,13 @@ divZero: failed arithmetic: division by zero: ./in.cue:8:10 div00: failed arithmetic: division undefined: ./in.cue:9:10 -idiv00: division by zero: +idiv00: error in call to div: division by zero: ./in.cue:13:9 -imod00: division by zero: +imod00: error in call to mod: division by zero: ./in.cue:14:9 -iquo00: division by zero: +iquo00: error in call to quo: division by zero: ./in.cue:15:9 -irem00: division by zero: +irem00: error in call to rem: division by zero: ./in.cue:16:9 e0: invalid operands 2 and "a" to '+' (type int and string): ./in.cue:23:5 @@ -116,19 +116,19 @@ Result: b: (bool){ true } add: (float){ 5.000000000000000000000000000000000 } idiv00: (_|_){ - // [eval] idiv00: division by zero: + // [eval] idiv00: error in call to div: division by zero: // ./in.cue:13:9 } imod00: (_|_){ - // [eval] imod00: division by zero: + // [eval] imod00: error in call to mod: division by zero: // ./in.cue:14:9 } iquo00: (_|_){ - // [eval] iquo00: division by zero: + // [eval] iquo00: error in call to quo: division by zero: // ./in.cue:15:9 } irem00: (_|_){ - // [eval] irem00: division by zero: + // [eval] irem00: error in call to rem: division by zero: // ./in.cue:16:9 } v1: (float){ 5.0E+11 } diff --git a/cue/testdata/builtins/056_issue314.txtar b/cue/testdata/builtins/056_issue314.txtar index 86f8524ed..9844a34d2 100644 --- a/cue/testdata/builtins/056_issue314.txtar +++ b/cue/testdata/builtins/056_issue314.txtar @@ -91,7 +91,8 @@ Disjuncts: 62 #V: (#struct){ s: (string){ string } out: (_|_){ - // [incomplete] cannot convert incomplete value "string" to JSON: + // [incomplete] #V.out: error in call to encoding/json.Marshal: cannot convert incomplete value "string" to JSON: + // ./in.cue:21:7 // ./in.cue:20:7 } } @@ -109,7 +110,7 @@ Disjuncts: 62 diff old new --- old +++ new -@@ -8,7 +8,7 @@ +@@ -8,13 +8,14 @@ out: (_|_){ // [incomplete] #T.out: error in call to text/template.Execute: cannot convert non-concrete value string: // ./in.cue:14:7 @@ -118,7 +119,15 @@ diff old new } } #V: (#struct){ -@@ -24,6 +24,7 @@ + s: (string){ string } + out: (_|_){ +- // [incomplete] cannot convert incomplete value "string" to JSON: ++ // [incomplete] #V.out: error in call to encoding/json.Marshal: cannot convert incomplete value "string" to JSON: ++ // ./in.cue:21:7 + // ./in.cue:20:7 + } + } +@@ -24,6 +25,7 @@ // [incomplete] #U.out: error in call to encoding/yaml.Marshal: incomplete value string: // ./in.cue:26:7 // ./in.cue:25:7 diff --git a/cue/testdata/builtins/closeall.txtar b/cue/testdata/builtins/closeall.txtar index 48dc8a8bc..fbce1f456 100644 --- a/cue/testdata/builtins/closeall.txtar +++ b/cue/testdata/builtins/closeall.txtar @@ -88,11 +88,11 @@ c.err.nested.extra: field not allowed: ./in.cue:19:3 f.err.extra: field not allowed: ./in.cue:28:14 -d.err: argument must be a struct or list literal: +d.err: error in call to __closeAll: argument must be a struct or list literal: ./in.cue:24:9 -g.err: argument must be a struct or list literal: +g.err: error in call to __closeAll: argument must be a struct or list literal: ./in.cue:32:9 -h.err: __closeAll may only be used when explicitopen is enabled: +h.err: error in call to __closeAll: __closeAll may only be used when explicitopen is enabled: ./old.cue:2:9 Result: @@ -136,7 +136,7 @@ Result: d: (_|_){ // [eval] err: (_|_){ - // [eval] d.err: argument must be a struct or list literal: + // [eval] d.err: error in call to __closeAll: argument must be a struct or list literal: // ./in.cue:24:9 } } @@ -158,14 +158,14 @@ Result: g: (_|_){ // [eval] err: (_|_){ - // [eval] g.err: argument must be a struct or list literal: + // [eval] g.err: error in call to __closeAll: argument must be a struct or list literal: // ./in.cue:32:9 } } h: (_|_){ // [eval] err: (_|_){ - // [eval] h.err: __closeAll may only be used when explicitopen is enabled: + // [eval] h.err: error in call to __closeAll: __closeAll may only be used when explicitopen is enabled: // ./old.cue:2:9 } } diff --git a/cue/testdata/builtins/incomplete.txtar b/cue/testdata/builtins/incomplete.txtar index b3457fae9..a9bc211d1 100644 --- a/cue/testdata/builtins/incomplete.txtar +++ b/cue/testdata/builtins/incomplete.txtar @@ -239,7 +239,8 @@ Result: // ./in.cue:50:17 } max: (_|_){ - // [incomplete] incompleteArgDecimalList.#a.transformed: operand param of '+' not concrete (was int): + // [incomplete] incompleteArgDecimalList.#a.max: error in call to list.Max: operand param of '+' not concrete (was int): + // ./in.cue:51:16 // ./in.cue:50:17 } } @@ -258,20 +259,21 @@ Result: // ./in.cue:58:16 } joined: (_|_){ - // [incomplete] incompleteArgStringList.#a.transformed: non-concrete value string in operand to +: - // ./in.cue:59:16 + // [incomplete] incompleteArgStringList.#a.joined: error in call to strings.Join: non-concrete value string in operand to +: + // ./in.cue:60:16 // ./in.cue:58:16 + // ./in.cue:59:16 } } } incompleteList: (struct){ x: (_){ _ } decimal: (_|_){ - // [incomplete] incompleteList.decimal: non-concrete list for argument 0: + // [incomplete] incompleteList.decimal: error in call to list.Max: non-concrete list for argument 0: // ./in.cue:66:11 } str: (_|_){ - // [incomplete] incompleteList.str: non-concrete list for argument 0: + // [incomplete] incompleteList.str: error in call to strings.Join: non-concrete list for argument 0: // ./in.cue:67:11 } } @@ -342,25 +344,45 @@ Result: diff old new --- old +++ new -@@ -89,7 +89,7 @@ +@@ -89,7 +89,8 @@ // ./in.cue:50:17 } max: (_|_){ - // [incomplete] incompleteArgDecimalList.#a.0: operand param of '+' not concrete (was int): -+ // [incomplete] incompleteArgDecimalList.#a.transformed: operand param of '+' not concrete (was int): ++ // [incomplete] incompleteArgDecimalList.#a.max: error in call to list.Max: operand param of '+' not concrete (was int): ++ // ./in.cue:51:16 // ./in.cue:50:17 } } -@@ -108,7 +108,7 @@ +@@ -108,9 +109,10 @@ // ./in.cue:58:16 } joined: (_|_){ - // [incomplete] incompleteArgStringList.#a.0: non-concrete value string in operand to +: -+ // [incomplete] incompleteArgStringList.#a.transformed: non-concrete value string in operand to +: - // ./in.cue:59:16 - // ./in.cue:58:16 +- // ./in.cue:59:16 +- // ./in.cue:58:16 ++ // [incomplete] incompleteArgStringList.#a.joined: error in call to strings.Join: non-concrete value string in operand to +: ++ // ./in.cue:60:16 ++ // ./in.cue:58:16 ++ // ./in.cue:59:16 } -@@ -129,15 +129,18 @@ + } + } +@@ -117,11 +119,11 @@ + incompleteList: (struct){ + x: (_){ _ } + decimal: (_|_){ +- // [incomplete] incompleteList.decimal: non-concrete list for argument 0: ++ // [incomplete] incompleteList.decimal: error in call to list.Max: non-concrete list for argument 0: + // ./in.cue:66:11 + } + str: (_|_){ +- // [incomplete] incompleteList.str: non-concrete list for argument 0: ++ // [incomplete] incompleteList.str: error in call to strings.Join: non-concrete list for argument 0: + // ./in.cue:67:11 + } + } +@@ -129,15 +131,18 @@ x: (_|_){ // [incomplete] incompleteListError.x: non-concrete value _ in operand to +: // ./in.cue:72:11 diff --git a/cue/testdata/builtins/intdiv.txtar b/cue/testdata/builtins/intdiv.txtar index 27c00b3f7..27dc75b05 100644 --- a/cue/testdata/builtins/intdiv.txtar +++ b/cue/testdata/builtins/intdiv.txtar @@ -50,25 +50,25 @@ Conjuncts: 29 Disjuncts: 29 -- out/evalalpha -- Errors: -quoDivByZero: division by zero: +quoDivByZero: error in call to quo: division by zero: ./in.cue:6:15 quoTypeError1: cannot use 2.0 (type float) as int in argument 1 to quo: ./in.cue:8:20 quoTypeError2: cannot use 1.0 (type float) as int in argument 2 to quo: ./in.cue:9:23 -remDivByZero: division by zero: +remDivByZero: error in call to rem: division by zero: ./in.cue:16:15 remTypeError1: cannot use 2.0 (type float) as int in argument 1 to rem: ./in.cue:18:20 remTypeError2: cannot use 1.0 (type float) as int in argument 2 to rem: ./in.cue:19:23 -divDivByZero: division by zero: +divDivByZero: error in call to div: division by zero: ./in.cue:26:15 divTypeError1: cannot use 2.0 (type float) as int in argument 1 to div: ./in.cue:28:20 divTypeError2: cannot use 1.0 (type float) as int in argument 2 to div: ./in.cue:29:23 -modDivByZero: division by zero: +modDivByZero: error in call to mod: division by zero: ./in.cue:36:15 modTypeError1: cannot use 2.0 (type float) as int in argument 1 to mod: ./in.cue:38:20 @@ -83,7 +83,7 @@ Result: quo3: (int){ -2 } quo4: (int){ 2 } quoDivByZero: (_|_){ - // [eval] quoDivByZero: division by zero: + // [eval] quoDivByZero: error in call to quo: division by zero: // ./in.cue:6:15 } quoTypeError1: (_|_){ @@ -99,7 +99,7 @@ Result: rem3: (int){ -1 } rem4: (int){ -1 } remDivByZero: (_|_){ - // [eval] remDivByZero: division by zero: + // [eval] remDivByZero: error in call to rem: division by zero: // ./in.cue:16:15 } remTypeError1: (_|_){ @@ -115,7 +115,7 @@ Result: div3: (int){ -3 } div4: (int){ 3 } divDivByZero: (_|_){ - // [eval] divDivByZero: division by zero: + // [eval] divDivByZero: error in call to div: division by zero: // ./in.cue:26:15 } divTypeError1: (_|_){ @@ -131,7 +131,7 @@ Result: mod3: (int){ 1 } mod4: (int){ 1 } modDivByZero: (_|_){ - // [eval] modDivByZero: division by zero: + // [eval] modDivByZero: error in call to mod: division by zero: // ./in.cue:36:15 } modTypeError1: (_|_){ diff --git a/cue/testdata/builtins/issue_3567.txtar b/cue/testdata/builtins/issue_3567.txtar index c82dd71c5..47c1e287a 100644 --- a/cue/testdata/builtins/issue_3567.txtar +++ b/cue/testdata/builtins/issue_3567.txtar @@ -24,14 +24,16 @@ Conjuncts: 6 Disjuncts: 7 -- out/evalalpha -- Errors: -0: not enough arguments in call to strings.Join (have 1, want 2): +a: error in call to strings.Join: not enough arguments in call to strings.Join (have 1, want 2): + ./in.cue:2:4 ./in.cue:2:20 Result: (_|_){ // [eval] a: (_|_){ - // [eval] 0: not enough arguments in call to strings.Join (have 1, want 2): + // [eval] a: error in call to strings.Join: not enough arguments in call to strings.Join (have 1, want 2): + // ./in.cue:2:4 // ./in.cue:2:20 } } diff --git a/cue/testdata/builtins/reclose.txtar b/cue/testdata/builtins/reclose.txtar index f39056817..a40d0c207 100644 --- a/cue/testdata/builtins/reclose.txtar +++ b/cue/testdata/builtins/reclose.txtar @@ -207,11 +207,11 @@ recursive.t4.err.nested.field2: conflicting values "hello" and int (mismatched t ./in.cue:17:19 ./in.cue:28:11 ./in.cue:31:12 -nonStructLiterals.t1.err: argument must be a struct or list literal: +nonStructLiterals.t1.err: error in call to __reclose: argument must be a struct or list literal: ./in.cue:54:11 -nonStructLiterals.t4.err: argument must be a struct or list literal: +nonStructLiterals.t4.err: error in call to __reclose: argument must be a struct or list literal: ./in.cue:58:11 -retro.t1.err: __reclose may only be used when explicitopen is enabled: +retro.t1.err: error in call to __reclose: __reclose may only be used when explicitopen is enabled: ./old.cue:3:11 Result: @@ -338,7 +338,7 @@ Result: t1: (_|_){ // [eval] err: (_|_){ - // [eval] nonStructLiterals.t1.err: argument must be a struct or list literal: + // [eval] nonStructLiterals.t1.err: error in call to __reclose: argument must be a struct or list literal: // ./in.cue:54:11 } } @@ -348,7 +348,7 @@ Result: t4: (_|_){ // [eval] err: (_|_){ - // [eval] nonStructLiterals.t4.err: argument must be a struct or list literal: + // [eval] nonStructLiterals.t4.err: error in call to __reclose: argument must be a struct or list literal: // ./in.cue:58:11 } } @@ -377,7 +377,7 @@ Result: t1: (_|_){ // [eval] err: (_|_){ - // [eval] retro.t1.err: __reclose may only be used when explicitopen is enabled: + // [eval] retro.t1.err: error in call to __reclose: __reclose may only be used when explicitopen is enabled: // ./old.cue:3:11 } } diff --git a/cue/testdata/compile/experiment.txtar b/cue/testdata/compile/experiment.txtar index b64646a0d..0a8db5050 100644 --- a/cue/testdata/compile/experiment.txtar +++ b/cue/testdata/compile/experiment.txtar @@ -30,14 +30,14 @@ Conjuncts: 4 Disjuncts: 3 -- out/evalalpha -- Errors: -off: testing experiment disabled: +off: error in call to testExperiment: testing experiment disabled: ./off.cue:1:6 Result: (_|_){ // [eval] off: (_|_){ - // [eval] off: testing experiment disabled: + // [eval] off: error in call to testExperiment: testing experiment disabled: // ./off.cue:1:6 } on: (string){ "on" } diff --git a/cue/testdata/cycle/builtins.txtar b/cue/testdata/cycle/builtins.txtar index 0a7191288..d708599a3 100644 --- a/cue/testdata/cycle/builtins.txtar +++ b/cue/testdata/cycle/builtins.txtar @@ -357,7 +357,7 @@ issue4037.cycle.f: invalid value "1233" (does not satisfy matchN): 0 matched, ex ./cycle.cue:39:14 ./cycle.cue:39:21 ./cycle.cue:40:5 -jsonCycle.t1.x.y: invalid value "{}" (does not satisfy encoding/json.Validate): error in call to encoding/json.Validate: structural cycle: +jsonCycle.t1.x.y: invalid value "{}" (does not satisfy encoding/json.Validate): structural cycle: ./jsoncycle.cue:4:8 ./jsoncycle.cue:5:8 listMatchN.structCycle.x.y: invalid value [{}] (does not satisfy list.MatchN): number of matched elements is 0: does not satisfy 1: @@ -410,10 +410,10 @@ selfCycle.t1.c.d.d: invalid value {d:{}} (does not satisfy matchN): 0 matched, e ./yamlcycle.cue:15:8 selfCycle.t1.c.d.d.d: structural cycle: ./yamlcycle.cue:14:5 -selfCycle.yamlVal.t1.x.y: invalid value "{}" (does not satisfy encoding/yaml.Validate): error in call to encoding/yaml.Validate: structural cycle: +selfCycle.yamlVal.t1.x.y: invalid value "{}" (does not satisfy encoding/yaml.Validate): structural cycle: ./yamlcycle.cue:24:8 ./yamlcycle.cue:25:8 -selfCycle.yamlVal.t2.x.y: invalid value "{}" (does not satisfy encoding/yaml.Validate): error in call to encoding/yaml.Validate: structural cycle: +selfCycle.yamlVal.t2.x.y: invalid value "{}" (does not satisfy encoding/yaml.Validate): structural cycle: ./yamlcycle.cue:30:8 ./yamlcycle.cue:31:8 ./yamlcycle.cue:32:8 @@ -422,7 +422,7 @@ selfCycle.yamlFun.t2.x.y: error in call to encoding/yaml.Validate: structural cy ./yamlcycle.cue:41:8 selfCycle.yamlFun.t2.z.y: error in call to encoding/yaml.Validate: structural cycle: ./yamlcycle.cue:41:8 -selfCycle.yamlValidatePartial.x.y: invalid value "{}" (does not satisfy encoding/yaml.ValidatePartial): error in call to encoding/yaml.ValidatePartial: structural cycle: +selfCycle.yamlValidatePartial.x.y: invalid value "{}" (does not satisfy encoding/yaml.ValidatePartial): structural cycle: ./yamlcycle.cue:44:8 ./yamlcycle.cue:45:8 @@ -634,7 +634,7 @@ Result: x: (_|_){ // [structural cycle] y: (_|_){ - // [structural cycle] jsonCycle.t1.x.y: invalid value "{}" (does not satisfy encoding/json.Validate): error in call to encoding/json.Validate: structural cycle: + // [structural cycle] jsonCycle.t1.x.y: invalid value "{}" (does not satisfy encoding/json.Validate): structural cycle: // ./jsoncycle.cue:4:8 // ./jsoncycle.cue:5:8 } @@ -876,7 +876,7 @@ Result: x: (_|_){ // [structural cycle] y: (_|_){ - // [structural cycle] selfCycle.yamlVal.t1.x.y: invalid value "{}" (does not satisfy encoding/yaml.Validate): error in call to encoding/yaml.Validate: structural cycle: + // [structural cycle] selfCycle.yamlVal.t1.x.y: invalid value "{}" (does not satisfy encoding/yaml.Validate): structural cycle: // ./yamlcycle.cue:24:8 // ./yamlcycle.cue:25:8 } @@ -887,7 +887,7 @@ Result: x: (_|_){ // [structural cycle] y: (_|_){ - // [structural cycle] selfCycle.yamlVal.t2.x.y: invalid value "{}" (does not satisfy encoding/yaml.Validate): error in call to encoding/yaml.Validate: structural cycle: + // [structural cycle] selfCycle.yamlVal.t2.x.y: invalid value "{}" (does not satisfy encoding/yaml.Validate): structural cycle: // ./yamlcycle.cue:30:8 // ./yamlcycle.cue:31:8 // ./yamlcycle.cue:32:8 @@ -926,7 +926,7 @@ Result: x: (_|_){ // [structural cycle] y: (_|_){ - // [structural cycle] selfCycle.yamlValidatePartial.x.y: invalid value "{}" (does not satisfy encoding/yaml.ValidatePartial): error in call to encoding/yaml.ValidatePartial: structural cycle: + // [structural cycle] selfCycle.yamlValidatePartial.x.y: invalid value "{}" (does not satisfy encoding/yaml.ValidatePartial): structural cycle: // ./yamlcycle.cue:44:8 // ./yamlcycle.cue:45:8 } @@ -980,7 +980,7 @@ diff old new + ./cycle.cue:39:14 + ./cycle.cue:39:21 + ./cycle.cue:40:5 -+jsonCycle.t1.x.y: invalid value "{}" (does not satisfy encoding/json.Validate): error in call to encoding/json.Validate: structural cycle: ++jsonCycle.t1.x.y: invalid value "{}" (does not satisfy encoding/json.Validate): structural cycle: + ./jsoncycle.cue:4:8 + ./jsoncycle.cue:5:8 +listMatchN.structCycle.x.y: invalid value [{}] (does not satisfy list.MatchN): number of matched elements is 0: does not satisfy 1: @@ -1028,10 +1028,10 @@ diff old new - ./yamlcycle.cue:41:28 -selfCycle.yamlValidatePartial.x.y.y: structural cycle: - ./yamlcycle.cue:44:29 -+selfCycle.yamlVal.t1.x.y: invalid value "{}" (does not satisfy encoding/yaml.Validate): error in call to encoding/yaml.Validate: structural cycle: ++selfCycle.yamlVal.t1.x.y: invalid value "{}" (does not satisfy encoding/yaml.Validate): structural cycle: + ./yamlcycle.cue:24:8 + ./yamlcycle.cue:25:8 -+selfCycle.yamlVal.t2.x.y: invalid value "{}" (does not satisfy encoding/yaml.Validate): error in call to encoding/yaml.Validate: structural cycle: ++selfCycle.yamlVal.t2.x.y: invalid value "{}" (does not satisfy encoding/yaml.Validate): structural cycle: + ./yamlcycle.cue:30:8 + ./yamlcycle.cue:31:8 + ./yamlcycle.cue:32:8 @@ -1040,7 +1040,7 @@ diff old new + ./yamlcycle.cue:41:8 +selfCycle.yamlFun.t2.z.y: error in call to encoding/yaml.Validate: structural cycle: + ./yamlcycle.cue:41:8 -+selfCycle.yamlValidatePartial.x.y: invalid value "{}" (does not satisfy encoding/yaml.ValidatePartial): error in call to encoding/yaml.ValidatePartial: structural cycle: ++selfCycle.yamlValidatePartial.x.y: invalid value "{}" (does not satisfy encoding/yaml.ValidatePartial): structural cycle: + ./yamlcycle.cue:44:8 + ./yamlcycle.cue:45:8 @@ -1200,7 +1200,7 @@ diff old new - // ./jsoncycle.cue:4:22 + // [structural cycle] + y: (_|_){ -+ // [structural cycle] jsonCycle.t1.x.y: invalid value "{}" (does not satisfy encoding/json.Validate): error in call to encoding/json.Validate: structural cycle: ++ // [structural cycle] jsonCycle.t1.x.y: invalid value "{}" (does not satisfy encoding/json.Validate): structural cycle: + // ./jsoncycle.cue:4:8 + // ./jsoncycle.cue:5:8 + } @@ -1345,7 +1345,7 @@ diff old new - // ./yamlcycle.cue:32:22 + // [structural cycle] + y: (_|_){ -+ // [structural cycle] selfCycle.yamlVal.t1.x.y: invalid value "{}" (does not satisfy encoding/yaml.Validate): error in call to encoding/yaml.Validate: structural cycle: ++ // [structural cycle] selfCycle.yamlVal.t1.x.y: invalid value "{}" (does not satisfy encoding/yaml.Validate): structural cycle: + // ./yamlcycle.cue:24:8 + // ./yamlcycle.cue:25:8 + } @@ -1356,7 +1356,7 @@ diff old new + x: (_|_){ + // [structural cycle] + y: (_|_){ -+ // [structural cycle] selfCycle.yamlVal.t2.x.y: invalid value "{}" (does not satisfy encoding/yaml.Validate): error in call to encoding/yaml.Validate: structural cycle: ++ // [structural cycle] selfCycle.yamlVal.t2.x.y: invalid value "{}" (does not satisfy encoding/yaml.Validate): structural cycle: + // ./yamlcycle.cue:30:8 + // ./yamlcycle.cue:31:8 + // ./yamlcycle.cue:32:8 @@ -1410,7 +1410,7 @@ diff old new - // ./yamlcycle.cue:44:29 + // [structural cycle] + y: (_|_){ -+ // [structural cycle] selfCycle.yamlValidatePartial.x.y: invalid value "{}" (does not satisfy encoding/yaml.ValidatePartial): error in call to encoding/yaml.ValidatePartial: structural cycle: ++ // [structural cycle] selfCycle.yamlValidatePartial.x.y: invalid value "{}" (does not satisfy encoding/yaml.ValidatePartial): structural cycle: + // ./yamlcycle.cue:44:8 + // ./yamlcycle.cue:45:8 + } diff --git a/cue/testdata/cycle/evaluate.txtar b/cue/testdata/cycle/evaluate.txtar index 4eb29a03e..22e5b740b 100644 --- a/cue/testdata/cycle/evaluate.txtar +++ b/cue/testdata/cycle/evaluate.txtar @@ -189,8 +189,12 @@ printCycle.a.X: structural cycle structCycle.c: structural cycle disjunctionCycle.b: cannot use 1 (type int) as list in argument 1 to and: ./in.cue:56:9 +listAddCycle.b: error in call to list.Concat: structural cycle: + ./in.cue:91:5 listAddCycle.c: structural cycle: ./in.cue:91:5 +listMulCycle.b: error in call to list.Repeat: structural cycle: + ./in.cue:97:5 listMulCycle.c: structural cycle: ./in.cue:97:5 @@ -318,11 +322,11 @@ Result: listAddCycle: (_|_){ // [structural cycle] a: (_|_){ - // [structural cycle] listAddCycle.c: structural cycle: + // [structural cycle] listAddCycle.b: error in call to list.Concat: structural cycle: // ./in.cue:91:5 } b: (_|_){ - // [structural cycle] listAddCycle.c: structural cycle: + // [structural cycle] listAddCycle.b: error in call to list.Concat: structural cycle: // ./in.cue:91:5 } c: (_|_){ @@ -333,11 +337,11 @@ Result: listMulCycle: (_|_){ // [structural cycle] a: (_|_){ - // [structural cycle] listMulCycle.c: structural cycle: + // [structural cycle] listMulCycle.b: error in call to list.Repeat: structural cycle: // ./in.cue:97:5 } b: (_|_){ - // [structural cycle] listMulCycle.c: structural cycle: + // [structural cycle] listMulCycle.b: error in call to list.Repeat: structural cycle: // ./in.cue:97:5 } c: (_|_){ @@ -378,7 +382,7 @@ Result: diff old new --- old +++ new -@@ -1,33 +1,18 @@ +@@ -1,33 +1,22 @@ Errors: -closeCycle.a: structural cycle -closeCycle.b.d: structural cycle @@ -415,14 +419,18 @@ diff old new +structCycle.c: structural cycle +disjunctionCycle.b: cannot use 1 (type int) as list in argument 1 to and: + ./in.cue:56:9 ++listAddCycle.b: error in call to list.Concat: structural cycle: ++ ./in.cue:91:5 +listAddCycle.c: structural cycle: + ./in.cue:91:5 ++listMulCycle.b: error in call to list.Repeat: structural cycle: ++ ./in.cue:97:5 +listMulCycle.c: structural cycle: + ./in.cue:97:5 Result: (_|_){ -@@ -65,14 +50,8 @@ +@@ -65,14 +54,8 @@ } t2: (struct){ a: (struct){ @@ -439,7 +447,7 @@ diff old new } x: (struct){ y: (string){ "" } -@@ -88,18 +67,15 @@ +@@ -88,18 +71,15 @@ disjunctionCycle: (_|_){ // [eval] a: (_|_){ @@ -467,7 +475,7 @@ diff old new // ./in.cue:56:9 } } -@@ -107,14 +83,13 @@ +@@ -107,14 +87,13 @@ // [structural cycle] #A: (_|_){ // [structural cycle] @@ -487,7 +495,7 @@ diff old new } } letCycleWithAnd: (struct){ -@@ -145,12 +120,11 @@ +@@ -145,12 +124,11 @@ b: (_|_){ // [structural cycle] d: (_|_){ @@ -505,6 +513,40 @@ diff old new } } embedCycle: (struct){ +@@ -164,11 +142,11 @@ + listAddCycle: (_|_){ + // [structural cycle] + a: (_|_){ +- // [structural cycle] listAddCycle.c: structural cycle: +- // ./in.cue:91:5 +- } +- b: (_|_){ +- // [structural cycle] listAddCycle.c: structural cycle: ++ // [structural cycle] listAddCycle.b: error in call to list.Concat: structural cycle: ++ // ./in.cue:91:5 ++ } ++ b: (_|_){ ++ // [structural cycle] listAddCycle.b: error in call to list.Concat: structural cycle: + // ./in.cue:91:5 + } + c: (_|_){ +@@ -179,11 +157,11 @@ + listMulCycle: (_|_){ + // [structural cycle] + a: (_|_){ +- // [structural cycle] listMulCycle.c: structural cycle: +- // ./in.cue:97:5 +- } +- b: (_|_){ +- // [structural cycle] listMulCycle.c: structural cycle: ++ // [structural cycle] listMulCycle.b: error in call to list.Repeat: structural cycle: ++ // ./in.cue:97:5 ++ } ++ b: (_|_){ ++ // [structural cycle] listMulCycle.b: error in call to list.Repeat: structural cycle: + // ./in.cue:97:5 + } + c: (_|_){ -- diff/explanation -- embedCycle: technically not a structural cycle, so V3 result is okay or even an improvement. diff --git a/cue/testdata/cycle/self.txtar b/cue/testdata/cycle/self.txtar index 8cbb70b3d..cb162e8d5 100644 --- a/cue/testdata/cycle/self.txtar +++ b/cue/testdata/cycle/self.txtar @@ -335,9 +335,9 @@ expr.error1.a: conflicting values 4 and 3: expr.error2.a: conflicting values 4 and 3: ./in.cue:10:5 ./in.cue:11:5 -0: structural cycle: +listConcat.error1.a: error in call to list.Concat: structural cycle: ./in.cue:15:5 -1: structural cycle: +listConcat.error2.a: error in call to list.Concat: structural cycle: ./in.cue:19:5 Result: @@ -367,14 +367,14 @@ Result: error1: (_|_){ // [structural cycle] a: (_|_){ - // [structural cycle] 0: structural cycle: + // [structural cycle] listConcat.error1.a: error in call to list.Concat: structural cycle: // ./in.cue:15:5 } } error2: (_|_){ // [structural cycle] a: (_|_){ - // [structural cycle] 1: structural cycle: + // [structural cycle] listConcat.error2.a: error in call to list.Concat: structural cycle: // ./in.cue:19:5 } } @@ -707,9 +707,9 @@ diff old new - ./in.cue:9:5 + ./in.cue:10:5 + ./in.cue:11:5 -+0: structural cycle: ++listConcat.error1.a: error in call to list.Concat: structural cycle: + ./in.cue:15:5 -+1: structural cycle: ++listConcat.error2.a: error in call to list.Concat: structural cycle: + ./in.cue:19:5 Result: @@ -751,14 +751,14 @@ diff old new - // [structural cycle] - 0: (string){ "1" } - 1: (string){ "2" } -+ // [structural cycle] 0: structural cycle: ++ // [structural cycle] listConcat.error1.a: error in call to list.Concat: structural cycle: + // ./in.cue:15:5 + } + } + error2: (_|_){ + // [structural cycle] + a: (_|_){ -+ // [structural cycle] 1: structural cycle: ++ // [structural cycle] listConcat.error2.a: error in call to list.Concat: structural cycle: + // ./in.cue:19:5 } } diff --git a/cue/testdata/cycle/structural.txtar b/cue/testdata/cycle/structural.txtar index 2db5cb094..e94c70f5f 100644 --- a/cue/testdata/cycle/structural.txtar +++ b/cue/testdata/cycle/structural.txtar @@ -721,7 +721,7 @@ resolveToAncestor.t2.X.b: structural cycle shortPathFail.elipsis.t2.Foo.ref: structural cycle withLetFail.schema.next: structural cycle z1.z.g: structural cycle -3: structural cycle: +fieldsSumInfinite.issue3310.total: error in call to list.Sum: error in call to list.Sum: structural cycle: ./in.cue:371:9 nestedList.v1e.y.0.0: incompatible list lengths (1 and 2): ./in.cue:438:6 @@ -1401,7 +1401,7 @@ Result: fries: (float){ 2.00 } sprite: (float){ 1.00 } total: (_|_){ - // [structural cycle] 3: structural cycle: + // [structural cycle] fieldsSumInfinite.issue3310.total: error in call to list.Sum: error in call to list.Sum: structural cycle: // ./in.cue:371:9 } } @@ -1925,7 +1925,7 @@ diff old new -d3.x.indirect: structural cycle: - ./in.cue:316:12 +z1.z.g: structural cycle -+3: structural cycle: ++fieldsSumInfinite.issue3310.total: error in call to list.Sum: error in call to list.Sum: structural cycle: + ./in.cue:371:9 +nestedList.v1e.y.0.0: incompatible list lengths (1 and 2): + ./in.cue:438:6 @@ -2021,6 +2021,15 @@ diff old new } } fieldsSumInfinite: (_|_){ +@@ -771,7 +767,7 @@ + fries: (float){ 2.00 } + sprite: (float){ 1.00 } + total: (_|_){ +- // [structural cycle] 3: structural cycle: ++ // [structural cycle] fieldsSumInfinite.issue3310.total: error in call to list.Sum: error in call to list.Sum: structural cycle: + // ./in.cue:371:9 + } + } @@ -839,11 +835,9 @@ // [eval] e3.a: conflicting values [a] and {c:a} (mismatched types list and struct): // ./in.cue:412:5 diff --git a/cue/testdata/disjunctions/incomplete.txtar b/cue/testdata/disjunctions/incomplete.txtar index 951c3aaab..85bc1d415 100644 --- a/cue/testdata/disjunctions/incomplete.txtar +++ b/cue/testdata/disjunctions/incomplete.txtar @@ -125,9 +125,9 @@ Disjuncts: 98 s: (string){ string } ok1: (_|_){ // [incomplete] func.ok1: 2 errors in empty disjunction: - // func.ok1: non-concrete argument 0: + // func.ok1: error in call to encoding/yaml.MarshalStream: non-concrete argument 0: // ./in.cue:26:7 - // func.ok1: non-concrete argument 0: + // func.ok1: error in call to encoding/yaml.Marshal: non-concrete argument 0: // ./in.cue:26:31 } } diff --git a/cue/testdata/eval/errunifiy.txtar b/cue/testdata/eval/errunifiy.txtar index 738adb053..e33a7f213 100644 --- a/cue/testdata/eval/errunifiy.txtar +++ b/cue/testdata/eval/errunifiy.txtar @@ -57,7 +57,7 @@ Result: (_|_){ // [user] a: (_|_){ - // [incomplete] empty list in call to or: + // [incomplete] a: error in call to or: empty list in call to or: // ./in.cue:1:4 } b: (_|_){ diff --git a/cue/testdata/eval/issue3672.txtar b/cue/testdata/eval/issue3672.txtar index 56d451adf..6e95ba05e 100644 --- a/cue/testdata/eval/issue3672.txtar +++ b/cue/testdata/eval/issue3672.txtar @@ -389,7 +389,8 @@ Disjuncts: 330375 #mkFinDefSet: (#struct){ #Definition!: ~(#FinDefSetDefinition) #Type: (_|_){ - // [incomplete] required field missing: #Definition: + // [incomplete] #mkFinDefSet.#Type: error in call to or: required field missing: #Definition: + // ./x.cue:22:9 // ./x.cue:22:25 } } @@ -799,7 +800,7 @@ diff old new #Alternatives: (#struct){ allBut: (#struct){ AllBut: (list){ -@@ -34,48 +28,11 @@ +@@ -34,48 +28,12 @@ } } #mkFinDefSet: (#struct){ @@ -847,13 +848,14 @@ diff old new - }) } + #Definition!: ~(#FinDefSetDefinition) + #Type: (_|_){ -+ // [incomplete] required field missing: #Definition: ++ // [incomplete] #mkFinDefSet.#Type: error in call to or: required field missing: #Definition: ++ // ./x.cue:22:9 + // ./x.cue:22:25 + } } #ConfigText: ((string|struct)){ |((string){ string }, (#struct){ UseSectionName: (bool){ true } -@@ -196,8 +153,41 @@ +@@ -196,8 +154,41 @@ }) } }) } _output: (_|_){ @@ -896,7 +898,7 @@ diff old new } } } -@@ -290,8 +280,41 @@ +@@ -290,8 +281,41 @@ }) } }) } orgSyntax: (_|_){ @@ -939,7 +941,7 @@ diff old new } } value0: (#struct){ -@@ -304,1165 +327,71 @@ +@@ -304,1165 +328,71 @@ 0: (string){ "UseSectionName" let INL#9 = (_|_){ @@ -2159,7 +2161,7 @@ diff old new // ./x.cue:22:52 // ./x.cue:44:29 // ./x.cue:44:56 -@@ -1479,7 +408,9 @@ +@@ -1479,7 +409,9 @@ // ./x.cue:118:38 // ./x.cue:123:9 // ./x.cue:124:16 diff --git a/cue/testdata/fulleval/032_or_builtin_should_not_fail_on_non-concrete_empty_list.txtar b/cue/testdata/fulleval/032_or_builtin_should_not_fail_on_non-concrete_empty_list.txtar index 6ecce2a7c..9d535facf 100644 --- a/cue/testdata/fulleval/032_or_builtin_should_not_fail_on_non-concrete_empty_list.txtar +++ b/cue/testdata/fulleval/032_or_builtin_should_not_fail_on_non-concrete_empty_list.txtar @@ -29,7 +29,7 @@ Disjuncts: 17 jobs: (#struct){ } #JobID: (_|_){ - // [incomplete] empty list in call to or: + // [incomplete] #Workflow.#JobID: error in call to or: empty list in call to or: // ./in.cue:6:10 } } diff --git a/cue/testdata/fulleval/048_dont_pass_incomplete_values_to_builtins.txtar b/cue/testdata/fulleval/048_dont_pass_incomplete_values_to_builtins.txtar index 5aa333cd3..d89c35dec 100644 --- a/cue/testdata/fulleval/048_dont_pass_incomplete_values_to_builtins.txtar +++ b/cue/testdata/fulleval/048_dont_pass_incomplete_values_to_builtins.txtar @@ -47,7 +47,7 @@ Disjuncts: 3 (struct){ input: (string){ string } foo: (_|_){ - // [incomplete] foo: non-concrete argument 0: + // [incomplete] foo: error in call to encoding/json.Marshal: non-concrete argument 0: // ./in.cue:4:8 } } diff --git a/cue/testdata/fulleval/049_alias_reuse_in_nested_scope.txtar b/cue/testdata/fulleval/049_alias_reuse_in_nested_scope.txtar index a6cb5366d..22f6a0559 100644 --- a/cue/testdata/fulleval/049_alias_reuse_in_nested_scope.txtar +++ b/cue/testdata/fulleval/049_alias_reuse_in_nested_scope.txtar @@ -30,11 +30,11 @@ Disjuncts: 29 (struct){ #Foo: (#struct){ let X#1 = (_|_){ - // [incomplete] empty list in call to or: + // [incomplete] #Foo.X: error in call to or: empty list in call to or: // ./in.cue:2:10 } connection: (_|_){ - // [incomplete] empty list in call to or: + // [incomplete] #Foo.X: error in call to or: empty list in call to or: // ./in.cue:2:10 } } diff --git a/cue/testdata/fulleval/050_json_Marshaling_detects_incomplete.txtar b/cue/testdata/fulleval/050_json_Marshaling_detects_incomplete.txtar index eb7ef7764..0067aa2d4 100644 --- a/cue/testdata/fulleval/050_json_Marshaling_detects_incomplete.txtar +++ b/cue/testdata/fulleval/050_json_Marshaling_detects_incomplete.txtar @@ -51,7 +51,8 @@ Disjuncts: 21 -- out/evalalpha -- (struct){ a: (_|_){ - // [incomplete] cannot convert incomplete value "string" to JSON: + // [incomplete] a: error in call to encoding/json.Marshal: cannot convert incomplete value "string" to JSON: + // ./in.cue:3:4 // ./in.cue:3:21 } foo: (struct){ @@ -62,7 +63,8 @@ Disjuncts: 21 } } b: (_|_){ - // [incomplete] foo.b: undefined field: c: + // [incomplete] b: error in call to encoding/json.Marshal: undefined field: c: + // ./in.cue:6:4 // ./in.cue:5:20 } } diff --git a/cue/testdata/fulleval/051_detectIncompleteYAML.txtar b/cue/testdata/fulleval/051_detectIncompleteYAML.txtar index a01379954..9383a2c00 100644 --- a/cue/testdata/fulleval/051_detectIncompleteYAML.txtar +++ b/cue/testdata/fulleval/051_detectIncompleteYAML.txtar @@ -39,7 +39,7 @@ Disjuncts: 17 use: (string){ string } } baz: (_|_){ - // [incomplete] #Spec.data.baz: non-concrete argument 0: + // [incomplete] #Spec.data.baz: error in call to encoding/yaml.Marshal: non-concrete argument 0: // ./in.cue:11:11 } foobar: (_|_){ @@ -67,6 +67,15 @@ Disjuncts: 17 diff old new --- old +++ new +@@ -8,7 +8,7 @@ + use: (string){ string } + } + baz: (_|_){ +- // [incomplete] #Spec.data.baz: non-concrete argument 0: ++ // [incomplete] #Spec.data.baz: error in call to encoding/yaml.Marshal: non-concrete argument 0: + // ./in.cue:11:11 + } + foobar: (_|_){ @@ -15,6 +15,7 @@ // [incomplete] #Spec.data.foobar: error in call to encoding/yaml.Marshal: incomplete value string: // ./in.cue:12:11 diff --git a/cue/testdata/fulleval/052_detectIncompleteJSON.txtar b/cue/testdata/fulleval/052_detectIncompleteJSON.txtar index f8987d5ba..1bb89a16c 100644 --- a/cue/testdata/fulleval/052_detectIncompleteJSON.txtar +++ b/cue/testdata/fulleval/052_detectIncompleteJSON.txtar @@ -39,11 +39,12 @@ Disjuncts: 17 use: (string){ string } } baz: (_|_){ - // [incomplete] #Spec.data.baz: non-concrete argument 0: + // [incomplete] #Spec.data.baz: error in call to encoding/json.Marshal: non-concrete argument 0: // ./in.cue:11:11 } foobar: (_|_){ - // [incomplete] cannot convert incomplete value "string" to JSON: + // [incomplete] #Spec.data.foobar: error in call to encoding/json.Marshal: cannot convert incomplete value "string" to JSON: + // ./in.cue:12:11 // ./in.cue:6:21 } } diff --git a/cue/testdata/resolve/048_builtins.txtar b/cue/testdata/resolve/048_builtins.txtar index 7083cbdf9..467887be7 100644 --- a/cue/testdata/resolve/048_builtins.txtar +++ b/cue/testdata/resolve/048_builtins.txtar @@ -104,12 +104,12 @@ a3.a: invalid value "bar" (out of bound =~"fo"): ./in.cue:9:5 ./in.cue:7:5 ./in.cue:12:14 -stringListErrors.b.result: invalid list element 0 in argument 0 to call: cannot use value int (int) as string: +stringListErrors.b.result: error in call to strings.Join: invalid list element 0 in argument 0 to call: cannot use value int (int) as string: ./in.cue:31:11 ./in.cue:30:7 stringListErrors.c.result: cannot use int (type int) as string in argument 2 to strings.Join: ./in.cue:36:27 -decimalListErrors.a.result: invalid list element 0 in argument 0 to call: cannot use value string (string) as number: +decimalListErrors.a.result: error in call to list.Avg: invalid list element 0 in argument 0 to call: cannot use value string (string) as number: ./in.cue:43:11 ./in.cue:42:7 @@ -176,7 +176,7 @@ Result: 0: (string){ string } } result: (_|_){ - // [incomplete] stringListErrors.a.result: non-concrete value string for element 0 of string list argument 0: + // [incomplete] stringListErrors.a.result: error in call to strings.Join: non-concrete value string for element 0 of string list argument 0: // ./in.cue:26:11 // ./in.cue:25:7 } @@ -187,7 +187,7 @@ Result: 0: (int){ int } } result: (_|_){ - // [eval] stringListErrors.b.result: invalid list element 0 in argument 0 to call: cannot use value int (int) as string: + // [eval] stringListErrors.b.result: error in call to strings.Join: invalid list element 0 in argument 0 to call: cannot use value int (int) as string: // ./in.cue:31:11 // ./in.cue:30:7 } @@ -210,7 +210,7 @@ Result: 0: (string){ string } } result: (_|_){ - // [eval] decimalListErrors.a.result: invalid list element 0 in argument 0 to call: cannot use value string (string) as number: + // [eval] decimalListErrors.a.result: error in call to list.Avg: invalid list element 0 in argument 0 to call: cannot use value string (string) as number: // ./in.cue:43:11 // ./in.cue:42:7 } @@ -220,7 +220,7 @@ Result: 0: (int){ int } } result: (_|_){ - // [incomplete] decimalListErrors.b.result: non-concrete value int for element 0 of number list argument 0: + // [incomplete] decimalListErrors.b.result: error in call to list.Avg: non-concrete value int for element 0 of number list argument 0: // ./in.cue:48:11 // ./in.cue:47:7 } diff --git a/encoding/jsonschema/testdata/external/tests/draft2019-09/optional/format/date-time.json b/encoding/jsonschema/testdata/external/tests/draft2019-09/optional/format/date-time.json index 0e3d503af..d5fd11451 100644 --- a/encoding/jsonschema/testdata/external/tests/draft2019-09/optional/format/date-time.json +++ b/encoding/jsonschema/testdata/external/tests/draft2019-09/optional/format/date-time.json @@ -94,7 +94,7 @@ "data": "1998-12-31T23:59:60Z", "valid": true, "skip": { - "v3": "6 errors in empty disjunction:\nconflicting values \"1998-12-31T23:59:60Z\" and [...] (mismatched types string and list):\n generated.cue:5:1\n generated.cue:5:36\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and bool (mismatched types string and bool):\n generated.cue:5:1\n generated.cue:5:8\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and null (mismatched types string and null):\n generated.cue:5:1\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and number (mismatched types string and number):\n generated.cue:5:1\n generated.cue:5:15\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and {...} (mismatched types string and struct):\n generated.cue:5:1\n generated.cue:5:44\n instance.json:1:1\ninvalid value \"1998-12-31T23:59:60Z\" (does not satisfy time.Time): error in call to time.Time: invalid time \"1998-12-31T23:59:60Z\":\n generated.cue:1:1\n instance.json:1:1\n", + "v3": "6 errors in empty disjunction:\nconflicting values \"1998-12-31T23:59:60Z\" and [...] (mismatched types string and list):\n generated.cue:5:1\n generated.cue:5:36\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and bool (mismatched types string and bool):\n generated.cue:5:1\n generated.cue:5:8\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and null (mismatched types string and null):\n generated.cue:5:1\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and number (mismatched types string and number):\n generated.cue:5:1\n generated.cue:5:15\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and {...} (mismatched types string and struct):\n generated.cue:5:1\n generated.cue:5:44\n instance.json:1:1\ninvalid value \"1998-12-31T23:59:60Z\" (does not satisfy time.Time): invalid time \"1998-12-31T23:59:60Z\":\n generated.cue:1:1\n instance.json:1:1\n", "v3-roundtrip": "could not extract schema" } }, @@ -103,7 +103,7 @@ "data": "1998-12-31T15:59:60.123-08:00", "valid": true, "skip": { - "v3": "6 errors in empty disjunction:\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and [...] (mismatched types string and list):\n generated.cue:5:1\n generated.cue:5:36\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and bool (mismatched types string and bool):\n generated.cue:5:1\n generated.cue:5:8\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and null (mismatched types string and null):\n generated.cue:5:1\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and number (mismatched types string and number):\n generated.cue:5:1\n generated.cue:5:15\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and {...} (mismatched types string and struct):\n generated.cue:5:1\n generated.cue:5:44\n instance.json:1:1\ninvalid value \"1998-12-31T15:59:60.123-08:00\" (does not satisfy time.Time): error in call to time.Time: invalid time \"1998-12-31T15:59:60.123-08:00\":\n generated.cue:1:1\n instance.json:1:1\n", + "v3": "6 errors in empty disjunction:\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and [...] (mismatched types string and list):\n generated.cue:5:1\n generated.cue:5:36\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and bool (mismatched types string and bool):\n generated.cue:5:1\n generated.cue:5:8\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and null (mismatched types string and null):\n generated.cue:5:1\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and number (mismatched types string and number):\n generated.cue:5:1\n generated.cue:5:15\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and {...} (mismatched types string and struct):\n generated.cue:5:1\n generated.cue:5:44\n instance.json:1:1\ninvalid value \"1998-12-31T15:59:60.123-08:00\" (does not satisfy time.Time): invalid time \"1998-12-31T15:59:60.123-08:00\":\n generated.cue:1:1\n instance.json:1:1\n", "v3-roundtrip": "could not extract schema" } }, @@ -169,7 +169,7 @@ "data": "1963-06-19t08:30:06.283185z", "valid": true, "skip": { - "v3": "6 errors in empty disjunction:\nconflicting values \"1963-06-19t08:30:06.283185z\" and [...] (mismatched types string and list):\n generated.cue:5:1\n generated.cue:5:36\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and bool (mismatched types string and bool):\n generated.cue:5:1\n generated.cue:5:8\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and null (mismatched types string and null):\n generated.cue:5:1\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and number (mismatched types string and number):\n generated.cue:5:1\n generated.cue:5:15\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and {...} (mismatched types string and struct):\n generated.cue:5:1\n generated.cue:5:44\n instance.json:1:1\ninvalid value \"1963-06-19t08:30:06.283185z\" (does not satisfy time.Time): error in call to time.Time: invalid time \"1963-06-19t08:30:06.283185z\":\n generated.cue:1:1\n instance.json:1:1\n", + "v3": "6 errors in empty disjunction:\nconflicting values \"1963-06-19t08:30:06.283185z\" and [...] (mismatched types string and list):\n generated.cue:5:1\n generated.cue:5:36\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and bool (mismatched types string and bool):\n generated.cue:5:1\n generated.cue:5:8\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and null (mismatched types string and null):\n generated.cue:5:1\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and number (mismatched types string and number):\n generated.cue:5:1\n generated.cue:5:15\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and {...} (mismatched types string and struct):\n generated.cue:5:1\n generated.cue:5:44\n instance.json:1:1\ninvalid value \"1963-06-19t08:30:06.283185z\" (does not satisfy time.Time): invalid time \"1963-06-19t08:30:06.283185z\":\n generated.cue:1:1\n instance.json:1:1\n", "v3-roundtrip": "could not extract schema" } }, diff --git a/encoding/jsonschema/testdata/external/tests/draft2020-12/format.json b/encoding/jsonschema/testdata/external/tests/draft2020-12/format.json index 5490240dc..f30752b00 100644 --- a/encoding/jsonschema/testdata/external/tests/draft2020-12/format.json +++ b/encoding/jsonschema/testdata/external/tests/draft2020-12/format.json @@ -129,7 +129,7 @@ "data": "^(abc]", "valid": true, "skip": { - "v3": "6 errors in empty disjunction:\nconflicting values \"^(abc]\" and [...] (mismatched types string and list):\n generated.cue:5:1\n generated.cue:5:39\n instance.json:1:1\nconflicting values \"^(abc]\" and bool (mismatched types string and bool):\n generated.cue:5:1\n generated.cue:5:8\n instance.json:1:1\nconflicting values \"^(abc]\" and null (mismatched types string and null):\n generated.cue:5:1\n instance.json:1:1\nconflicting values \"^(abc]\" and number (mismatched types string and number):\n generated.cue:5:1\n generated.cue:5:15\n instance.json:1:1\nconflicting values \"^(abc]\" and {...} (mismatched types string and struct):\n generated.cue:5:1\n generated.cue:5:47\n instance.json:1:1\ninvalid value \"^(abc]\" (does not satisfy regexp.Valid): error in call to regexp.Valid: error parsing regexp: missing closing ): `^(abc]`:\n generated.cue:1:1\n instance.json:1:1\n" + "v3": "6 errors in empty disjunction:\nconflicting values \"^(abc]\" and [...] (mismatched types string and list):\n generated.cue:5:1\n generated.cue:5:39\n instance.json:1:1\nconflicting values \"^(abc]\" and bool (mismatched types string and bool):\n generated.cue:5:1\n generated.cue:5:8\n instance.json:1:1\nconflicting values \"^(abc]\" and null (mismatched types string and null):\n generated.cue:5:1\n instance.json:1:1\nconflicting values \"^(abc]\" and number (mismatched types string and number):\n generated.cue:5:1\n generated.cue:5:15\n instance.json:1:1\nconflicting values \"^(abc]\" and {...} (mismatched types string and struct):\n generated.cue:5:1\n generated.cue:5:47\n instance.json:1:1\ninvalid value \"^(abc]\" (does not satisfy regexp.Valid): error parsing regexp: missing closing ): `^(abc]`:\n generated.cue:1:1\n instance.json:1:1\n" } } ] @@ -352,8 +352,8 @@ "data": "06/19/1963", "valid": true, "skip": { - "v3": "6 errors in empty disjunction:\nconflicting values \"06/19/1963\" and [...] (mismatched types string and list):\n generated.cue:5:1\n generated.cue:5:52\n instance.json:1:1\nconflicting values \"06/19/1963\" and bool (mismatched types string and bool):\n generated.cue:5:1\n generated.cue:5:8\n instance.json:1:1\nconflicting values \"06/19/1963\" and null (mismatched types string and null):\n generated.cue:5:1\n instance.json:1:1\nconflicting values \"06/19/1963\" and number (mismatched types string and number):\n generated.cue:5:1\n generated.cue:5:15\n instance.json:1:1\nconflicting values \"06/19/1963\" and {...} (mismatched types string and struct):\n generated.cue:5:1\n generated.cue:5:60\n instance.json:1:1\ninvalid value \"06/19/1963\" (does not satisfy time.Format(\"2006-01-02\")): error in call to time.Format: invalid time \"06/19/1963\":\n generated.cue:5:24\n generated.cue:1:1\n generated.cue:5:36\n instance.json:1:1\n", - "v3-roundtrip": "conflicting values \"06/19/1963\" and [...] (mismatched types string and list):\n instance.json:1:1\nconflicting values \"06/19/1963\" and bool (mismatched types string and bool):\n instance.json:1:1\nconflicting values \"06/19/1963\" and null (mismatched types string and null):\n instance.json:1:1\nconflicting values \"06/19/1963\" and number (mismatched types string and number):\n instance.json:1:1\nconflicting values \"06/19/1963\" and {...} (mismatched types string and struct):\n instance.json:1:1\ninvalid value \"06/19/1963\" (does not satisfy time.Format(\"2006-01-02\")): error in call to time.Format: invalid time \"06/19/1963\":\n instance.json:1:1\ninvalid value \"06/19/1963\" (does not satisfy matchN): 0 matched, expected \u003e=1:\n instance.json:1:1\n" + "v3": "6 errors in empty disjunction:\nconflicting values \"06/19/1963\" and [...] (mismatched types string and list):\n generated.cue:5:1\n generated.cue:5:52\n instance.json:1:1\nconflicting values \"06/19/1963\" and bool (mismatched types string and bool):\n generated.cue:5:1\n generated.cue:5:8\n instance.json:1:1\nconflicting values \"06/19/1963\" and null (mismatched types string and null):\n generated.cue:5:1\n instance.json:1:1\nconflicting values \"06/19/1963\" and number (mismatched types string and number):\n generated.cue:5:1\n generated.cue:5:15\n instance.json:1:1\nconflicting values \"06/19/1963\" and {...} (mismatched types string and struct):\n generated.cue:5:1\n generated.cue:5:60\n instance.json:1:1\ninvalid value \"06/19/1963\" (does not satisfy time.Format(\"2006-01-02\")): invalid time \"06/19/1963\":\n generated.cue:5:24\n generated.cue:1:1\n generated.cue:5:36\n instance.json:1:1\n", + "v3-roundtrip": "conflicting values \"06/19/1963\" and [...] (mismatched types string and list):\n instance.json:1:1\nconflicting values \"06/19/1963\" and bool (mismatched types string and bool):\n instance.json:1:1\nconflicting values \"06/19/1963\" and null (mismatched types string and null):\n instance.json:1:1\nconflicting values \"06/19/1963\" and number (mismatched types string and number):\n instance.json:1:1\nconflicting values \"06/19/1963\" and {...} (mismatched types string and struct):\n instance.json:1:1\ninvalid value \"06/19/1963\" (does not satisfy time.Format(\"2006-01-02\")): invalid time \"06/19/1963\":\n instance.json:1:1\ninvalid value \"06/19/1963\" (does not satisfy matchN): 0 matched, expected \u003e=1:\n instance.json:1:1\n" } } ] @@ -400,7 +400,7 @@ "data": "1990-02-31T15:59:60.123-08:00", "valid": true, "skip": { - "v3": "6 errors in empty disjunction:\nconflicting values \"1990-02-31T15:59:60.123-08:00\" and [...] (mismatched types string and list):\n generated.cue:5:1\n generated.cue:5:36\n instance.json:1:1\nconflicting values \"1990-02-31T15:59:60.123-08:00\" and bool (mismatched types string and bool):\n generated.cue:5:1\n generated.cue:5:8\n instance.json:1:1\nconflicting values \"1990-02-31T15:59:60.123-08:00\" and null (mismatched types string and null):\n generated.cue:5:1\n instance.json:1:1\nconflicting values \"1990-02-31T15:59:60.123-08:00\" and number (mismatched types string and number):\n generated.cue:5:1\n generated.cue:5:15\n instance.json:1:1\nconflicting values \"1990-02-31T15:59:60.123-08:00\" and {...} (mismatched types string and struct):\n generated.cue:5:1\n generated.cue:5:44\n instance.json:1:1\ninvalid value \"1990-02-31T15:59:60.123-08:00\" (does not satisfy time.Time): error in call to time.Time: invalid time \"1990-02-31T15:59:60.123-08:00\":\n generated.cue:1:1\n instance.json:1:1\n" + "v3": "6 errors in empty disjunction:\nconflicting values \"1990-02-31T15:59:60.123-08:00\" and [...] (mismatched types string and list):\n generated.cue:5:1\n generated.cue:5:36\n instance.json:1:1\nconflicting values \"1990-02-31T15:59:60.123-08:00\" and bool (mismatched types string and bool):\n generated.cue:5:1\n generated.cue:5:8\n instance.json:1:1\nconflicting values \"1990-02-31T15:59:60.123-08:00\" and null (mismatched types string and null):\n generated.cue:5:1\n instance.json:1:1\nconflicting values \"1990-02-31T15:59:60.123-08:00\" and number (mismatched types string and number):\n generated.cue:5:1\n generated.cue:5:15\n instance.json:1:1\nconflicting values \"1990-02-31T15:59:60.123-08:00\" and {...} (mismatched types string and struct):\n generated.cue:5:1\n generated.cue:5:44\n instance.json:1:1\ninvalid value \"1990-02-31T15:59:60.123-08:00\" (does not satisfy time.Time): invalid time \"1990-02-31T15:59:60.123-08:00\":\n generated.cue:1:1\n instance.json:1:1\n" } } ] @@ -667,7 +667,7 @@ "data": "//foo.bar/?baz=qux#quux", "valid": true, "skip": { - "v3": "6 errors in empty disjunction:\nconflicting values \"//foo.bar/?baz=qux#quux\" and [...] (mismatched types string and list):\n generated.cue:5:1\n generated.cue:5:37\n instance.json:1:1\nconflicting values \"//foo.bar/?baz=qux#quux\" and bool (mismatched types string and bool):\n generated.cue:5:1\n generated.cue:5:8\n instance.json:1:1\nconflicting values \"//foo.bar/?baz=qux#quux\" and null (mismatched types string and null):\n generated.cue:5:1\n instance.json:1:1\nconflicting values \"//foo.bar/?baz=qux#quux\" and number (mismatched types string and number):\n generated.cue:5:1\n generated.cue:5:15\n instance.json:1:1\nconflicting values \"//foo.bar/?baz=qux#quux\" and {...} (mismatched types string and struct):\n generated.cue:5:1\n generated.cue:5:45\n instance.json:1:1\ninvalid value \"//foo.bar/?baz=qux#quux\" (does not satisfy net.AbsURL): error in call to net.AbsURL: URL is not absolute:\n generated.cue:1:1\n instance.json:1:1\n" + "v3": "6 errors in empty disjunction:\nconflicting values \"//foo.bar/?baz=qux#quux\" and [...] (mismatched types string and list):\n generated.cue:5:1\n generated.cue:5:37\n instance.json:1:1\nconflicting values \"//foo.bar/?baz=qux#quux\" and bool (mismatched types string and bool):\n generated.cue:5:1\n generated.cue:5:8\n instance.json:1:1\nconflicting values \"//foo.bar/?baz=qux#quux\" and null (mismatched types string and null):\n generated.cue:5:1\n instance.json:1:1\nconflicting values \"//foo.bar/?baz=qux#quux\" and number (mismatched types string and number):\n generated.cue:5:1\n generated.cue:5:15\n instance.json:1:1\nconflicting values \"//foo.bar/?baz=qux#quux\" and {...} (mismatched types string and struct):\n generated.cue:5:1\n generated.cue:5:45\n instance.json:1:1\ninvalid value \"//foo.bar/?baz=qux#quux\" (does not satisfy net.AbsURL): URL is not absolute:\n generated.cue:1:1\n instance.json:1:1\n" } } ] diff --git a/encoding/jsonschema/testdata/external/tests/draft2020-12/optional/format/date-time.json b/encoding/jsonschema/testdata/external/tests/draft2020-12/optional/format/date-time.json index a370bd510..ffb0661a1 100644 --- a/encoding/jsonschema/testdata/external/tests/draft2020-12/optional/format/date-time.json +++ b/encoding/jsonschema/testdata/external/tests/draft2020-12/optional/format/date-time.json @@ -61,7 +61,7 @@ "data": "1998-12-31T23:59:60Z", "valid": true, "skip": { - "v3": "6 errors in empty disjunction:\nconflicting values \"1998-12-31T23:59:60Z\" and [...] (mismatched types string and list):\n generated.cue:5:1\n generated.cue:5:36\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and bool (mismatched types string and bool):\n generated.cue:5:1\n generated.cue:5:8\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and null (mismatched types string and null):\n generated.cue:5:1\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and number (mismatched types string and number):\n generated.cue:5:1\n generated.cue:5:15\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and {...} (mismatched types string and struct):\n generated.cue:5:1\n generated.cue:5:44\n instance.json:1:1\ninvalid value \"1998-12-31T23:59:60Z\" (does not satisfy time.Time): error in call to time.Time: invalid time \"1998-12-31T23:59:60Z\":\n generated.cue:1:1\n instance.json:1:1\n" + "v3": "6 errors in empty disjunction:\nconflicting values \"1998-12-31T23:59:60Z\" and [...] (mismatched types string and list):\n generated.cue:5:1\n generated.cue:5:36\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and bool (mismatched types string and bool):\n generated.cue:5:1\n generated.cue:5:8\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and null (mismatched types string and null):\n generated.cue:5:1\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and number (mismatched types string and number):\n generated.cue:5:1\n generated.cue:5:15\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and {...} (mismatched types string and struct):\n generated.cue:5:1\n generated.cue:5:44\n instance.json:1:1\ninvalid value \"1998-12-31T23:59:60Z\" (does not satisfy time.Time): invalid time \"1998-12-31T23:59:60Z\":\n generated.cue:1:1\n instance.json:1:1\n" } }, { @@ -69,7 +69,7 @@ "data": "1998-12-31T15:59:60.123-08:00", "valid": true, "skip": { - "v3": "6 errors in empty disjunction:\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and [...] (mismatched types string and list):\n generated.cue:5:1\n generated.cue:5:36\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and bool (mismatched types string and bool):\n generated.cue:5:1\n generated.cue:5:8\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and null (mismatched types string and null):\n generated.cue:5:1\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and number (mismatched types string and number):\n generated.cue:5:1\n generated.cue:5:15\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and {...} (mismatched types string and struct):\n generated.cue:5:1\n generated.cue:5:44\n instance.json:1:1\ninvalid value \"1998-12-31T15:59:60.123-08:00\" (does not satisfy time.Time): error in call to time.Time: invalid time \"1998-12-31T15:59:60.123-08:00\":\n generated.cue:1:1\n instance.json:1:1\n" + "v3": "6 errors in empty disjunction:\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and [...] (mismatched types string and list):\n generated.cue:5:1\n generated.cue:5:36\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and bool (mismatched types string and bool):\n generated.cue:5:1\n generated.cue:5:8\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and null (mismatched types string and null):\n generated.cue:5:1\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and number (mismatched types string and number):\n generated.cue:5:1\n generated.cue:5:15\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and {...} (mismatched types string and struct):\n generated.cue:5:1\n generated.cue:5:44\n instance.json:1:1\ninvalid value \"1998-12-31T15:59:60.123-08:00\" (does not satisfy time.Time): invalid time \"1998-12-31T15:59:60.123-08:00\":\n generated.cue:1:1\n instance.json:1:1\n" } }, { @@ -134,7 +134,7 @@ "data": "1963-06-19t08:30:06.283185z", "valid": true, "skip": { - "v3": "6 errors in empty disjunction:\nconflicting values \"1963-06-19t08:30:06.283185z\" and [...] (mismatched types string and list):\n generated.cue:5:1\n generated.cue:5:36\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and bool (mismatched types string and bool):\n generated.cue:5:1\n generated.cue:5:8\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and null (mismatched types string and null):\n generated.cue:5:1\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and number (mismatched types string and number):\n generated.cue:5:1\n generated.cue:5:15\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and {...} (mismatched types string and struct):\n generated.cue:5:1\n generated.cue:5:44\n instance.json:1:1\ninvalid value \"1963-06-19t08:30:06.283185z\" (does not satisfy time.Time): error in call to time.Time: invalid time \"1963-06-19t08:30:06.283185z\":\n generated.cue:1:1\n instance.json:1:1\n" + "v3": "6 errors in empty disjunction:\nconflicting values \"1963-06-19t08:30:06.283185z\" and [...] (mismatched types string and list):\n generated.cue:5:1\n generated.cue:5:36\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and bool (mismatched types string and bool):\n generated.cue:5:1\n generated.cue:5:8\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and null (mismatched types string and null):\n generated.cue:5:1\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and number (mismatched types string and number):\n generated.cue:5:1\n generated.cue:5:15\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and {...} (mismatched types string and struct):\n generated.cue:5:1\n generated.cue:5:44\n instance.json:1:1\ninvalid value \"1963-06-19t08:30:06.283185z\" (does not satisfy time.Time): invalid time \"1963-06-19t08:30:06.283185z\":\n generated.cue:1:1\n instance.json:1:1\n" } }, { diff --git a/encoding/jsonschema/testdata/external/tests/draft4/optional/format/date-time.json b/encoding/jsonschema/testdata/external/tests/draft4/optional/format/date-time.json index d64b2a458..db6652f40 100644 --- a/encoding/jsonschema/testdata/external/tests/draft4/optional/format/date-time.json +++ b/encoding/jsonschema/testdata/external/tests/draft4/optional/format/date-time.json @@ -93,7 +93,7 @@ "data": "1998-12-31T23:59:60Z", "valid": true, "skip": { - "v3": "6 errors in empty disjunction:\nconflicting values \"1998-12-31T23:59:60Z\" and [...] (mismatched types string and list):\n generated.cue:3:1\n generated.cue:3:36\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and bool (mismatched types string and bool):\n generated.cue:3:1\n generated.cue:3:8\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and null (mismatched types string and null):\n generated.cue:3:1\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and number (mismatched types string and number):\n generated.cue:3:1\n generated.cue:3:15\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and {...} (mismatched types string and struct):\n generated.cue:3:1\n generated.cue:3:44\n instance.json:1:1\ninvalid value \"1998-12-31T23:59:60Z\" (does not satisfy time.Time): error in call to time.Time: invalid time \"1998-12-31T23:59:60Z\":\n generated.cue:1:1\n instance.json:1:1\n", + "v3": "6 errors in empty disjunction:\nconflicting values \"1998-12-31T23:59:60Z\" and [...] (mismatched types string and list):\n generated.cue:3:1\n generated.cue:3:36\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and bool (mismatched types string and bool):\n generated.cue:3:1\n generated.cue:3:8\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and null (mismatched types string and null):\n generated.cue:3:1\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and number (mismatched types string and number):\n generated.cue:3:1\n generated.cue:3:15\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and {...} (mismatched types string and struct):\n generated.cue:3:1\n generated.cue:3:44\n instance.json:1:1\ninvalid value \"1998-12-31T23:59:60Z\" (does not satisfy time.Time): invalid time \"1998-12-31T23:59:60Z\":\n generated.cue:1:1\n instance.json:1:1\n", "v3-roundtrip": "could not extract schema" } }, @@ -102,7 +102,7 @@ "data": "1998-12-31T15:59:60.123-08:00", "valid": true, "skip": { - "v3": "6 errors in empty disjunction:\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and [...] (mismatched types string and list):\n generated.cue:3:1\n generated.cue:3:36\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and bool (mismatched types string and bool):\n generated.cue:3:1\n generated.cue:3:8\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and null (mismatched types string and null):\n generated.cue:3:1\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and number (mismatched types string and number):\n generated.cue:3:1\n generated.cue:3:15\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and {...} (mismatched types string and struct):\n generated.cue:3:1\n generated.cue:3:44\n instance.json:1:1\ninvalid value \"1998-12-31T15:59:60.123-08:00\" (does not satisfy time.Time): error in call to time.Time: invalid time \"1998-12-31T15:59:60.123-08:00\":\n generated.cue:1:1\n instance.json:1:1\n", + "v3": "6 errors in empty disjunction:\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and [...] (mismatched types string and list):\n generated.cue:3:1\n generated.cue:3:36\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and bool (mismatched types string and bool):\n generated.cue:3:1\n generated.cue:3:8\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and null (mismatched types string and null):\n generated.cue:3:1\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and number (mismatched types string and number):\n generated.cue:3:1\n generated.cue:3:15\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and {...} (mismatched types string and struct):\n generated.cue:3:1\n generated.cue:3:44\n instance.json:1:1\ninvalid value \"1998-12-31T15:59:60.123-08:00\" (does not satisfy time.Time): invalid time \"1998-12-31T15:59:60.123-08:00\":\n generated.cue:1:1\n instance.json:1:1\n", "v3-roundtrip": "could not extract schema" } }, @@ -168,7 +168,7 @@ "data": "1963-06-19t08:30:06.283185z", "valid": true, "skip": { - "v3": "6 errors in empty disjunction:\nconflicting values \"1963-06-19t08:30:06.283185z\" and [...] (mismatched types string and list):\n generated.cue:3:1\n generated.cue:3:36\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and bool (mismatched types string and bool):\n generated.cue:3:1\n generated.cue:3:8\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and null (mismatched types string and null):\n generated.cue:3:1\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and number (mismatched types string and number):\n generated.cue:3:1\n generated.cue:3:15\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and {...} (mismatched types string and struct):\n generated.cue:3:1\n generated.cue:3:44\n instance.json:1:1\ninvalid value \"1963-06-19t08:30:06.283185z\" (does not satisfy time.Time): error in call to time.Time: invalid time \"1963-06-19t08:30:06.283185z\":\n generated.cue:1:1\n instance.json:1:1\n", + "v3": "6 errors in empty disjunction:\nconflicting values \"1963-06-19t08:30:06.283185z\" and [...] (mismatched types string and list):\n generated.cue:3:1\n generated.cue:3:36\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and bool (mismatched types string and bool):\n generated.cue:3:1\n generated.cue:3:8\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and null (mismatched types string and null):\n generated.cue:3:1\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and number (mismatched types string and number):\n generated.cue:3:1\n generated.cue:3:15\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and {...} (mismatched types string and struct):\n generated.cue:3:1\n generated.cue:3:44\n instance.json:1:1\ninvalid value \"1963-06-19t08:30:06.283185z\" (does not satisfy time.Time): invalid time \"1963-06-19t08:30:06.283185z\":\n generated.cue:1:1\n instance.json:1:1\n", "v3-roundtrip": "could not extract schema" } }, diff --git a/encoding/jsonschema/testdata/external/tests/draft6/optional/format/date-time.json b/encoding/jsonschema/testdata/external/tests/draft6/optional/format/date-time.json index d64b2a458..db6652f40 100644 --- a/encoding/jsonschema/testdata/external/tests/draft6/optional/format/date-time.json +++ b/encoding/jsonschema/testdata/external/tests/draft6/optional/format/date-time.json @@ -93,7 +93,7 @@ "data": "1998-12-31T23:59:60Z", "valid": true, "skip": { - "v3": "6 errors in empty disjunction:\nconflicting values \"1998-12-31T23:59:60Z\" and [...] (mismatched types string and list):\n generated.cue:3:1\n generated.cue:3:36\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and bool (mismatched types string and bool):\n generated.cue:3:1\n generated.cue:3:8\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and null (mismatched types string and null):\n generated.cue:3:1\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and number (mismatched types string and number):\n generated.cue:3:1\n generated.cue:3:15\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and {...} (mismatched types string and struct):\n generated.cue:3:1\n generated.cue:3:44\n instance.json:1:1\ninvalid value \"1998-12-31T23:59:60Z\" (does not satisfy time.Time): error in call to time.Time: invalid time \"1998-12-31T23:59:60Z\":\n generated.cue:1:1\n instance.json:1:1\n", + "v3": "6 errors in empty disjunction:\nconflicting values \"1998-12-31T23:59:60Z\" and [...] (mismatched types string and list):\n generated.cue:3:1\n generated.cue:3:36\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and bool (mismatched types string and bool):\n generated.cue:3:1\n generated.cue:3:8\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and null (mismatched types string and null):\n generated.cue:3:1\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and number (mismatched types string and number):\n generated.cue:3:1\n generated.cue:3:15\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and {...} (mismatched types string and struct):\n generated.cue:3:1\n generated.cue:3:44\n instance.json:1:1\ninvalid value \"1998-12-31T23:59:60Z\" (does not satisfy time.Time): invalid time \"1998-12-31T23:59:60Z\":\n generated.cue:1:1\n instance.json:1:1\n", "v3-roundtrip": "could not extract schema" } }, @@ -102,7 +102,7 @@ "data": "1998-12-31T15:59:60.123-08:00", "valid": true, "skip": { - "v3": "6 errors in empty disjunction:\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and [...] (mismatched types string and list):\n generated.cue:3:1\n generated.cue:3:36\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and bool (mismatched types string and bool):\n generated.cue:3:1\n generated.cue:3:8\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and null (mismatched types string and null):\n generated.cue:3:1\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and number (mismatched types string and number):\n generated.cue:3:1\n generated.cue:3:15\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and {...} (mismatched types string and struct):\n generated.cue:3:1\n generated.cue:3:44\n instance.json:1:1\ninvalid value \"1998-12-31T15:59:60.123-08:00\" (does not satisfy time.Time): error in call to time.Time: invalid time \"1998-12-31T15:59:60.123-08:00\":\n generated.cue:1:1\n instance.json:1:1\n", + "v3": "6 errors in empty disjunction:\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and [...] (mismatched types string and list):\n generated.cue:3:1\n generated.cue:3:36\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and bool (mismatched types string and bool):\n generated.cue:3:1\n generated.cue:3:8\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and null (mismatched types string and null):\n generated.cue:3:1\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and number (mismatched types string and number):\n generated.cue:3:1\n generated.cue:3:15\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and {...} (mismatched types string and struct):\n generated.cue:3:1\n generated.cue:3:44\n instance.json:1:1\ninvalid value \"1998-12-31T15:59:60.123-08:00\" (does not satisfy time.Time): invalid time \"1998-12-31T15:59:60.123-08:00\":\n generated.cue:1:1\n instance.json:1:1\n", "v3-roundtrip": "could not extract schema" } }, @@ -168,7 +168,7 @@ "data": "1963-06-19t08:30:06.283185z", "valid": true, "skip": { - "v3": "6 errors in empty disjunction:\nconflicting values \"1963-06-19t08:30:06.283185z\" and [...] (mismatched types string and list):\n generated.cue:3:1\n generated.cue:3:36\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and bool (mismatched types string and bool):\n generated.cue:3:1\n generated.cue:3:8\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and null (mismatched types string and null):\n generated.cue:3:1\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and number (mismatched types string and number):\n generated.cue:3:1\n generated.cue:3:15\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and {...} (mismatched types string and struct):\n generated.cue:3:1\n generated.cue:3:44\n instance.json:1:1\ninvalid value \"1963-06-19t08:30:06.283185z\" (does not satisfy time.Time): error in call to time.Time: invalid time \"1963-06-19t08:30:06.283185z\":\n generated.cue:1:1\n instance.json:1:1\n", + "v3": "6 errors in empty disjunction:\nconflicting values \"1963-06-19t08:30:06.283185z\" and [...] (mismatched types string and list):\n generated.cue:3:1\n generated.cue:3:36\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and bool (mismatched types string and bool):\n generated.cue:3:1\n generated.cue:3:8\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and null (mismatched types string and null):\n generated.cue:3:1\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and number (mismatched types string and number):\n generated.cue:3:1\n generated.cue:3:15\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and {...} (mismatched types string and struct):\n generated.cue:3:1\n generated.cue:3:44\n instance.json:1:1\ninvalid value \"1963-06-19t08:30:06.283185z\" (does not satisfy time.Time): invalid time \"1963-06-19t08:30:06.283185z\":\n generated.cue:1:1\n instance.json:1:1\n", "v3-roundtrip": "could not extract schema" } }, diff --git a/encoding/jsonschema/testdata/external/tests/draft7/optional/format/date-time.json b/encoding/jsonschema/testdata/external/tests/draft7/optional/format/date-time.json index d64b2a458..db6652f40 100644 --- a/encoding/jsonschema/testdata/external/tests/draft7/optional/format/date-time.json +++ b/encoding/jsonschema/testdata/external/tests/draft7/optional/format/date-time.json @@ -93,7 +93,7 @@ "data": "1998-12-31T23:59:60Z", "valid": true, "skip": { - "v3": "6 errors in empty disjunction:\nconflicting values \"1998-12-31T23:59:60Z\" and [...] (mismatched types string and list):\n generated.cue:3:1\n generated.cue:3:36\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and bool (mismatched types string and bool):\n generated.cue:3:1\n generated.cue:3:8\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and null (mismatched types string and null):\n generated.cue:3:1\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and number (mismatched types string and number):\n generated.cue:3:1\n generated.cue:3:15\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and {...} (mismatched types string and struct):\n generated.cue:3:1\n generated.cue:3:44\n instance.json:1:1\ninvalid value \"1998-12-31T23:59:60Z\" (does not satisfy time.Time): error in call to time.Time: invalid time \"1998-12-31T23:59:60Z\":\n generated.cue:1:1\n instance.json:1:1\n", + "v3": "6 errors in empty disjunction:\nconflicting values \"1998-12-31T23:59:60Z\" and [...] (mismatched types string and list):\n generated.cue:3:1\n generated.cue:3:36\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and bool (mismatched types string and bool):\n generated.cue:3:1\n generated.cue:3:8\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and null (mismatched types string and null):\n generated.cue:3:1\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and number (mismatched types string and number):\n generated.cue:3:1\n generated.cue:3:15\n instance.json:1:1\nconflicting values \"1998-12-31T23:59:60Z\" and {...} (mismatched types string and struct):\n generated.cue:3:1\n generated.cue:3:44\n instance.json:1:1\ninvalid value \"1998-12-31T23:59:60Z\" (does not satisfy time.Time): invalid time \"1998-12-31T23:59:60Z\":\n generated.cue:1:1\n instance.json:1:1\n", "v3-roundtrip": "could not extract schema" } }, @@ -102,7 +102,7 @@ "data": "1998-12-31T15:59:60.123-08:00", "valid": true, "skip": { - "v3": "6 errors in empty disjunction:\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and [...] (mismatched types string and list):\n generated.cue:3:1\n generated.cue:3:36\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and bool (mismatched types string and bool):\n generated.cue:3:1\n generated.cue:3:8\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and null (mismatched types string and null):\n generated.cue:3:1\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and number (mismatched types string and number):\n generated.cue:3:1\n generated.cue:3:15\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and {...} (mismatched types string and struct):\n generated.cue:3:1\n generated.cue:3:44\n instance.json:1:1\ninvalid value \"1998-12-31T15:59:60.123-08:00\" (does not satisfy time.Time): error in call to time.Time: invalid time \"1998-12-31T15:59:60.123-08:00\":\n generated.cue:1:1\n instance.json:1:1\n", + "v3": "6 errors in empty disjunction:\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and [...] (mismatched types string and list):\n generated.cue:3:1\n generated.cue:3:36\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and bool (mismatched types string and bool):\n generated.cue:3:1\n generated.cue:3:8\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and null (mismatched types string and null):\n generated.cue:3:1\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and number (mismatched types string and number):\n generated.cue:3:1\n generated.cue:3:15\n instance.json:1:1\nconflicting values \"1998-12-31T15:59:60.123-08:00\" and {...} (mismatched types string and struct):\n generated.cue:3:1\n generated.cue:3:44\n instance.json:1:1\ninvalid value \"1998-12-31T15:59:60.123-08:00\" (does not satisfy time.Time): invalid time \"1998-12-31T15:59:60.123-08:00\":\n generated.cue:1:1\n instance.json:1:1\n", "v3-roundtrip": "could not extract schema" } }, @@ -168,7 +168,7 @@ "data": "1963-06-19t08:30:06.283185z", "valid": true, "skip": { - "v3": "6 errors in empty disjunction:\nconflicting values \"1963-06-19t08:30:06.283185z\" and [...] (mismatched types string and list):\n generated.cue:3:1\n generated.cue:3:36\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and bool (mismatched types string and bool):\n generated.cue:3:1\n generated.cue:3:8\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and null (mismatched types string and null):\n generated.cue:3:1\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and number (mismatched types string and number):\n generated.cue:3:1\n generated.cue:3:15\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and {...} (mismatched types string and struct):\n generated.cue:3:1\n generated.cue:3:44\n instance.json:1:1\ninvalid value \"1963-06-19t08:30:06.283185z\" (does not satisfy time.Time): error in call to time.Time: invalid time \"1963-06-19t08:30:06.283185z\":\n generated.cue:1:1\n instance.json:1:1\n", + "v3": "6 errors in empty disjunction:\nconflicting values \"1963-06-19t08:30:06.283185z\" and [...] (mismatched types string and list):\n generated.cue:3:1\n generated.cue:3:36\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and bool (mismatched types string and bool):\n generated.cue:3:1\n generated.cue:3:8\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and null (mismatched types string and null):\n generated.cue:3:1\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and number (mismatched types string and number):\n generated.cue:3:1\n generated.cue:3:15\n instance.json:1:1\nconflicting values \"1963-06-19t08:30:06.283185z\" and {...} (mismatched types string and struct):\n generated.cue:3:1\n generated.cue:3:44\n instance.json:1:1\ninvalid value \"1963-06-19t08:30:06.283185z\" (does not satisfy time.Time): invalid time \"1963-06-19t08:30:06.283185z\":\n generated.cue:1:1\n instance.json:1:1\n", "v3-roundtrip": "could not extract schema" } }, diff --git a/encoding/jsonschema/testdata/generate/callop.txtar b/encoding/jsonschema/testdata/generate/callop.txtar index 3c5644df6..b58d817f0 100644 --- a/encoding/jsonschema/testdata/generate/callop.txtar +++ b/encoding/jsonschema/testdata/generate/callop.txtar @@ -131,11 +131,11 @@ badScore2: { } } -- out/generate-v3/badDate -- -badDate.data.date: invalid value "2025-10-40" (does not satisfy time.Format("2006-01-02")): error in call to time.Format: invalid time "2025-10-40": +badDate.data.date: invalid value "2025-10-40" (does not satisfy time.Format("2006-01-02")): invalid time "2025-10-40": 1:170 ./datatest/tests.cue:30:14 -- out/generate-v3/badDateTime -- -badDateTime.data.dateTime: invalid value "2025-10-02T13" (does not satisfy time.Time): error in call to time.Time: invalid time "2025-10-02T13": +badDateTime.data.dateTime: invalid value "2025-10-02T13" (does not satisfy time.Time): invalid time "2025-10-02T13": ./datatest/tests.cue:26:18 1:215 -- out/generate-v3/badScore2 -- @@ -144,7 +144,7 @@ badScore2.data.score: invalid value 5 (does not satisfy math.MultipleOf(10)): ./datatest/tests.cue:42:15 1:376 -- out/generate-v3/badTime -- -badTime.data.date: invalid value "25:00:10" (does not satisfy time.Format("2006-01-02")): error in call to time.Format: invalid time "25:00:10": +badTime.data.date: invalid value "25:00:10" (does not satisfy time.Format("2006-01-02")): invalid time "25:00:10": 1:170 ./datatest/tests.cue:34:14 -- out/generate-v3/badUserName -- diff --git a/encoding/jsonschema/testdata/txtar/openapi_date.txtar b/encoding/jsonschema/testdata/txtar/openapi_date.txtar index 59f15c5f5..b9c272b91 100644 --- a/encoding/jsonschema/testdata/txtar/openapi_date.txtar +++ b/encoding/jsonschema/testdata/txtar/openapi_date.txtar @@ -18,7 +18,7 @@ import "time" #schema #Date "2023-02-30" -- out/decode/testerr/err-out-of-range -- -#Date: invalid value "2023-02-30" (does not satisfy time.Format("2006-01-02")): error in call to time.Format: invalid time "2023-02-30": +#Date: invalid value "2023-02-30" (does not satisfy time.Format("2006-01-02")): invalid time "2023-02-30": generated.cue:3:8 generated.cue:3:20 test/err-out-of-range.json:2:1 diff --git a/internal/core/adt/expr.go b/internal/core/adt/expr.go index 48dfe5615..6ab45a0a6 100644 --- a/internal/core/adt/expr.go +++ b/internal/core/adt/expr.go @@ -1560,8 +1560,16 @@ func (builtin *Builtin) rawCall(c *OpContext, call *CallExpr, state Flags) Value } callCtx.args = args result := builtin.call(callCtx) - if result == nil { + switch result := result.(type) { + case nil: return nil + case *Bottom: + vErr := c.NewPosf(Pos(call), "error in call to %s", builtin.qualifiedName(c)) + return &Bottom{ + Code: result.Code, + Err: errors.Wrap(vErr, result.Err), + Node: c.vertex, + } } v, ci := c.evalStateCI(result, Flags{status: partial, condition: state.condition, mode: state.mode}) c.ci = ci diff --git a/internal/pkg/builtin.go b/internal/pkg/builtin.go index 4ffaf6901..e02056813 100644 --- a/internal/pkg/builtin.go +++ b/internal/pkg/builtin.go @@ -191,13 +191,6 @@ func mustParseConstBuiltin(ctx adt.Runtime, name, val string) adt.Expr { } -func (x *Builtin) name(ctx *adt.OpContext) string { - if x.Pkg == 0 { - return x.Name - } - return fmt.Sprintf("%s.%s", x.Pkg.StringValue(ctx), x.Name) -} - func processErr(call *CallCtxt, errVal interface{}, ret adt.Expr) adt.Expr { switch err := errVal.(type) { case nil: @@ -216,7 +209,7 @@ func processErr(call *CallCtxt, errVal interface{}, ret adt.Expr) adt.Expr { } } case Bottomer: - ret = wrapCallErr(call, err.Bottom()) + ret = err.Bottom() case errors.Error: // Convert lists of errors to a combined Bottom error. @@ -232,20 +225,20 @@ func processErr(call *CallCtxt, errVal interface{}, ret adt.Expr) adt.Expr { } } - ret = wrapCallErr(call, &adt.Bottom{Err: err}) + ret = &adt.Bottom{Err: err} case error: // TODO: store the underlying error explicitly - ret = wrapCallErr(call, &adt.Bottom{Err: errors.Promote(err, "")}) + ret = &adt.Bottom{Err: errors.Promote(err, "")} case string, fmt.Stringer: // A string or a stringer likely used as a panic value. - ret = wrapCallErr(call, &adt.Bottom{ + ret = &adt.Bottom{ Err: errors.Newf(call.ctx.Pos(), "%s", err), - }) + } default: // Some other value used when panicking; likely a bug. - ret = wrapCallErr(call, &adt.Bottom{ + ret = &adt.Bottom{ Err: errors.Newf(call.ctx.Pos(), "BUG: non-stringifiable %T", err), - }) + } } return ret } diff --git a/internal/pkg/context.go b/internal/pkg/context.go index 567d79f54..9550ae657 100644 --- a/internal/pkg/context.go +++ b/internal/pkg/context.go @@ -35,10 +35,6 @@ type CallCtxt struct { Ret any } -func (c *CallCtxt) Name() string { - return c.builtin.name(c.ctx) -} - // Do returns whether the call should be done. func (c *CallCtxt) Do() bool { return c.Err == nil @@ -120,8 +116,8 @@ func (c *CallCtxt) intValue(i, bitLen int, typ string) int64 { return 0 } if n.BitLen() > bitLen { - c.errf(err, "int %s overflows %s in argument %d in call to %s", - n, typ, i, c.Name()) + c.errf(err, "int %s overflows %s in argument %d", + n, typ, i) } res, _ := x.Int64() return res @@ -151,8 +147,8 @@ func (c *CallCtxt) uintValue(i, bitLen int, typ string) uint64 { return 0 } if n.BitLen() > bitLen { - c.errf(err, "int %s overflows %s in argument %d in call to %s", - n, typ, i, c.Name()) + c.errf(err, "int %s overflows %s in argument %d", + n, typ, i) } res, _ := x.Uint64() return res diff --git a/internal/pkg/errors.go b/internal/pkg/errors.go index 4c06c2ae5..af6683a4f 100644 --- a/internal/pkg/errors.go +++ b/internal/pkg/errors.go @@ -58,15 +58,6 @@ func (c *CallCtxt) errcf(code adt.ErrorCode, format string, args ...interface{}) c.Err = &callError{err} } -func wrapCallErr(c *CallCtxt, b *adt.Bottom) *adt.Bottom { - var err errors.Error - for _, e := range errors.Errors(b.Err) { - ne := c.ctx.Newf("error in call to %s", c.builtin.name(c.ctx)) - err = errors.Append(err, errors.Wrap(ne, e)) - } - return &adt.Bottom{Code: b.Code, Err: err} -} - func (c *CallCtxt) invalidArgType(arg adt.Value, i int, typ string, err error) { if ve, ok := err.(Bottomer); ok && ve.Bottom().IsIncomplete() { c.Err = ve @@ -80,11 +71,11 @@ func (c *CallCtxt) invalidArgType(arg adt.Value, i int, typ string, err error) { // a reference. if err != nil { c.errf(err, - "cannot use %s (type %s) as %s in argument %d to %s", - arg, arg.Kind(), typ, i, c.Name()) + "cannot use %s (type %s) as %s in argument %d", + arg, arg.Kind(), typ, i) } else { c.errf(err, - "cannot use %s (type %s) as %s in argument %d to %s", - arg, arg.Kind(), typ, i, c.Name()) + "cannot use %s (type %s) as %s in argument %d", + arg, arg.Kind(), typ, i) } } diff --git a/pkg/encoding/yaml/testdata/validate.txtar b/pkg/encoding/yaml/testdata/validate.txtar index 681b21136..41602c496 100644 --- a/pkg/encoding/yaml/testdata/validate.txtar +++ b/pkg/encoding/yaml/testdata/validate.txtar @@ -34,7 +34,7 @@ validatePartial: #test & { invalidDisjuntion: yaml.Validate("a: 3", {a: 1 | 2}) -- out/yaml -- Errors: -validate.t1.ok1: invalid value "a: 2" (does not satisfy encoding/yaml.Validate): error in call to encoding/yaml.Validate: incomplete value {a:2} | {a:2,b!:int}: +validate.t1.ok1: invalid value "a: 2" (does not satisfy encoding/yaml.Validate): incomplete value {a:2} | {a:2,b!:int}: ./in.cue:8:11 ./in.cue:6:9 ./in.cue:7:16 @@ -79,7 +79,7 @@ validate: { // TODO: fix this test: the second disjunct should be eliminated, so there // should not be a concreteness error. t1: { - ok1: _|_ // validate.t1.ok1: invalid value "a: 2" (does not satisfy encoding/yaml.Validate): validate.t1.ok1: error in call to encoding/yaml.Validate: validate.t1.ok1: incomplete value {a:2} | {a:2,b!:int} + ok1: _|_ // validate.t1.ok1: invalid value "a: 2" (does not satisfy encoding/yaml.Validate): validate.t1.ok1: incomplete value {a:2} | {a:2,b!:int} ok2: "a: 2" ok3: "a: 2" } diff --git a/pkg/list/testdata/gen.txtar b/pkg/list/testdata/gen.txtar index 1a18f0679..d277ba2bf 100644 --- a/pkg/list/testdata/gen.txtar +++ b/pkg/list/testdata/gen.txtar @@ -62,7 +62,7 @@ t52: list.MaxItems([1, 2, 3, 4], 5) t53: list.MaxItems([1, 2, 3, 4], 2) t54: list.Sort([{a: 1}, {b: 2}], list.Ascending) t55: list.Avg([4, 8, 12]) --- out/list -- +-- out/list-v3 -- Errors: t2: error in call to list.Avg: empty list: ./in.cue:4:6 @@ -102,7 +102,7 @@ t36: error in call to list.Slice: slice bounds out of range: t40: error in call to list.Sort: 2 errors in empty disjunction:: ./in.cue:46:6 list:13:9 -t42: invalid list element 0 in argument 0 to call: cannot use value 1 (int) as string: +t42: error in call to list.SortStrings: invalid list element 0 in argument 0 to call: cannot use value 1 (int) as string: ./in.cue:48:6 ./in.cue:48:24 t45: cannot use "foo" (type string) as list in argument 1 to list.Sum: @@ -164,7 +164,7 @@ t39: [{ }] t40: _|_ // t40: error in call to list.Sort: Ascending.x: 2 errors in empty disjunction: (and 5 more errors) t41: ["a", "b"] -t42: _|_ // t42: invalid list element 0 in argument 0 to call: cannot use value 1 (int) as string +t42: _|_ // t42: error in call to list.SortStrings: t42: invalid list element 0 in argument 0 to call: cannot use value 1 (int) as string t43: 10 t44: 0 t45: _|_ // t45: cannot use "foo" (type string) as list in argument 1 to list.Sum diff --git a/pkg/list/testdata/issues.txtar b/pkg/list/testdata/issues.txtar index ebabe0729..7ddbfca24 100644 --- a/pkg/list/testdata/issues.txtar +++ b/pkg/list/testdata/issues.txtar @@ -100,10 +100,11 @@ issue3416: sumSecond: { } -- out/list-v3 -- Errors: -0: invalid operands 2 and {num:6} to '+' (type int and struct): - ./in.cue:53:3 +issue3541: error in call to list.Sum: invalid operands 2 and {num:6} to '+' (type int and struct): + ./in.cue:52:2 ./in.cue:35:9 ./in.cue:36:10 + ./in.cue:53:3 Result: issue563: { @@ -128,7 +129,7 @@ issue1404: { a: *1 | 2 sum: 1 } -issue3541: _|_ // 0: invalid operands 2 and {num:6} to '+' (type int and struct) +issue3541: _|_ // issue3541: error in call to list.Sum: 0: invalid operands 2 and {num:6} to '+' (type int and struct) issue2594: { sumFirst: { #Def: { @@ -171,7 +172,7 @@ issue3416: { diff old new --- old +++ new -@@ -1,11 +1,8 @@ +@@ -1,11 +1,9 @@ Errors: -issue2594.sumSecond.x: conflicting values 0 and 6: - ./in.cue:71:3 @@ -180,23 +181,24 @@ diff old new - ./in.cue:75:6 -issue3416.sumFirst.a.b: field y not allowed by earlier comprehension or reference cycle -issue3416.sumFirst.a.b: field z not allowed by earlier comprehension or reference cycle -+0: invalid operands 2 and {num:6} to '+' (type int and struct): -+ ./in.cue:53:3 ++issue3541: error in call to list.Sum: invalid operands 2 and {num:6} to '+' (type int and struct): ++ ./in.cue:52:2 + ./in.cue:35:9 + ./in.cue:36:10 ++ ./in.cue:53:3 Result: issue563: { -@@ -30,7 +27,7 @@ +@@ -30,7 +28,7 @@ a: *1 | 2 sum: 1 } -issue3541: {} -+issue3541: _|_ // 0: invalid operands 2 and {num:6} to '+' (type int and struct) ++issue3541: _|_ // issue3541: error in call to list.Sum: 0: invalid operands 2 and {num:6} to '+' (type int and struct) issue2594: { sumFirst: { #Def: { -@@ -47,13 +44,18 @@ +@@ -47,13 +45,18 @@ 0 #In: [...number] } diff --git a/pkg/math/testdata/gen.txtar b/pkg/math/testdata/gen.txtar index 72b1615ae..58a2486db 100644 --- a/pkg/math/testdata/gen.txtar +++ b/pkg/math/testdata/gen.txtar @@ -22,13 +22,13 @@ t30: math.Log10(4) t31: math.Log2(5) t32: math.Dim(3, 2.5) t33: math.Dim(5, 7.2) --- out/math -- +-- out/math-v3 -- Errors: t3: cannot call non-function math.Pi (type float): ./in.cue:4:6 t6: error in call to math.Jacobi: big: invalid 2nd argument to Int.Jacobi: need odd integer but got 2000: ./in.cue:5:6 -t8: cannot use 2.0E+400 (type float) as float64 in argument 0 to math.Asin: value was rounded up: +t8: error in call to math.Asin: cannot use 2.0E+400 (type float) as float64 in argument 0: value was rounded up: ./in.cue:7:6 ./in.cue:7:16 @@ -37,7 +37,7 @@ t2: 3 t3: _|_ // t3: cannot call non-function math.Pi (type float) t6: _|_ // t6: error in call to math.Jacobi: big: invalid 2nd argument to Int.Jacobi: need odd integer but got 2000 t7: 1 -t8: _|_ // t8: cannot use 2.0E+400 (type float) as float64 in argument 0 to math.Asin: value was rounded up +t8: _|_ // t8: error in call to math.Asin: t8: cannot use 2.0E+400 (type float) as float64 in argument 0: value was rounded up t16: 4096 t17: 10000 t18: true diff --git a/pkg/net/testdata/gen.txtar b/pkg/net/testdata/gen.txtar index 07855d87c..1b9556295 100644 --- a/pkg/net/testdata/gen.txtar +++ b/pkg/net/testdata/gen.txtar @@ -56,27 +56,27 @@ t46: net.AddIPCIDR("10.0.0.0/8", -11) t47: net.AddIPCIDR("255.0.0.0/8", 1) -- out/net-v3 -- Errors: -t20b: invalid value 123 (does not satisfy net.IPCIDR): error in call to net.IPCIDR: invalid type int for IP CIDR: +t20b: invalid value 123 (does not satisfy net.IPCIDR): invalid type int for IP CIDR: ./in.cue:23:7 -t20c: invalid value 123 (does not satisfy net.IP): error in call to net.IP: invalid type int for IP address: +t20c: invalid value 123 (does not satisfy net.IP): invalid type int for IP address: ./in.cue:24:7 -t20d: invalid value 123 (does not satisfy net.IPv4): error in call to net.IPv4: invalid type int for IP address: +t20d: invalid value 123 (does not satisfy net.IPv4): invalid type int for IP address: ./in.cue:25:7 -t20e: invalid value 123 (does not satisfy net.IPv6): error in call to net.IPv6: invalid type int for IP address: +t20e: invalid value 123 (does not satisfy net.IPv6): invalid type int for IP address: ./in.cue:26:7 -t25: invalid value "2001:db8::1234567" (does not satisfy net.IPv6): error in call to net.IPv6: ParseAddr("2001:db8::1234567"): each group must have 4 or less digits (at "1234567"): +t25: invalid value "2001:db8::1234567" (does not satisfy net.IPv6): ParseAddr("2001:db8::1234567"): each group must have 4 or less digits (at "1234567"): ./in.cue:31:6 ./in.cue:31:17 -t30: invalid value "%" (does not satisfy net.URL): error in call to net.URL: parse "%": invalid URL escape "%": +t30: invalid value "%" (does not satisfy net.URL): parse "%": invalid URL escape "%": ./in.cue:36:6 ./in.cue:36:16 -t32: invalid value "/foo/bar" (does not satisfy net.AbsURL): error in call to net.AbsURL: URL is not absolute: +t32: invalid value "/foo/bar" (does not satisfy net.AbsURL): URL is not absolute: ./in.cue:38:6 ./in.cue:38:19 -t34: invalid value "%" (does not satisfy net.AbsURL): error in call to net.AbsURL: parse "%": invalid URL escape "%": +t34: invalid value "%" (does not satisfy net.AbsURL): parse "%": invalid URL escape "%": ./in.cue:40:6 ./in.cue:40:19 -t9: invalid value "23.23.23.2333" (does not satisfy net.IPv4): error in call to net.IPv4: ParseAddr("23.23.23.2333"): IPv4 field has value >255: +t9: invalid value "23.23.23.2333" (does not satisfy net.IPv4): ParseAddr("23.23.23.2333"): IPv4 field has value >255: ./in.cue:11:6 ./in.cue:11:17 t7: error in call to net.JoinHostPort: invalid host [192, 30, 4]: @@ -111,7 +111,7 @@ t5: "[2001:db8::1]:80" t6: "192.30.4.2:80" t7: _|_ // t7: error in call to net.JoinHostPort: invalid host [192, 30, 4] t8: true -t9: _|_ // t9: invalid value "23.23.23.2333" (does not satisfy net.IPv4): t9: error in call to net.IPv4: ParseAddr("23.23.23.2333"): IPv4 field has value >255 +t9: _|_ // t9: invalid value "23.23.23.2333" (does not satisfy net.IPv4): ParseAddr("23.23.23.2333"): IPv4 field has value >255 t10: true t11: true t12: false @@ -123,24 +123,24 @@ t17: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 127, 0, 0, 1] t18: true t19: true t20: _|_ // t20: error in call to net.IPCIDR: netip.ParsePrefix("172.16.12.3"): no '/' -t20b: _|_ // t20b: invalid value 123 (does not satisfy net.IPCIDR): t20b: error in call to net.IPCIDR: invalid type int for IP CIDR -t20c: _|_ // t20c: invalid value 123 (does not satisfy net.IP): t20c: error in call to net.IP: invalid type int for IP address -t20d: _|_ // t20d: invalid value 123 (does not satisfy net.IPv4): t20d: error in call to net.IPv4: invalid type int for IP address -t20e: _|_ // t20e: invalid value 123 (does not satisfy net.IPv6): t20e: error in call to net.IPv6: invalid type int for IP address +t20b: _|_ // t20b: invalid value 123 (does not satisfy net.IPCIDR): invalid type int for IP CIDR +t20c: _|_ // t20c: invalid value 123 (does not satisfy net.IP): invalid type int for IP address +t20d: _|_ // t20d: invalid value 123 (does not satisfy net.IPv4): invalid type int for IP address +t20e: _|_ // t20e: invalid value 123 (does not satisfy net.IPv6): invalid type int for IP address t21: "foo%2Fbar" t22: "foo/bar" t23: "f%25o" t24: "f%o" -t25: _|_ // t25: invalid value "2001:db8::1234567" (does not satisfy net.IPv6): t25: error in call to net.IPv6: ParseAddr("2001:db8::1234567"): each group must have 4 or less digits (at "1234567") +t25: _|_ // t25: invalid value "2001:db8::1234567" (does not satisfy net.IPv6): ParseAddr("2001:db8::1234567"): each group must have 4 or less digits (at "1234567") t26: true t27: _|_ // t27: invalid value "23.23.23.23" (does not satisfy net.IPv6) t28: true t29: "/foo/bar" -t30: _|_ // t30: invalid value "%" (does not satisfy net.URL): t30: error in call to net.URL: parse "%": invalid URL escape "%" +t30: _|_ // t30: invalid value "%" (does not satisfy net.URL): parse "%": invalid URL escape "%" t31: "https://foo.com/bar" -t32: _|_ // t32: invalid value "/foo/bar" (does not satisfy net.AbsURL): t32: error in call to net.AbsURL: URL is not absolute +t32: _|_ // t32: invalid value "/foo/bar" (does not satisfy net.AbsURL): URL is not absolute t33: "https://foo.com/bar" -t34: _|_ // t34: invalid value "%" (does not satisfy net.AbsURL): t34: error in call to net.AbsURL: parse "%": invalid URL escape "%" +t34: _|_ // t34: invalid value "%" (does not satisfy net.AbsURL): parse "%": invalid URL escape "%" t35: "127.0.0.2" t36: "127.0.0.3/8" t37: "2001:db8::1" diff --git a/pkg/regexp/testdata/gen.txtar b/pkg/regexp/testdata/gen.txtar index 988bbd593..09dbf60e8 100644 --- a/pkg/regexp/testdata/gen.txtar +++ b/pkg/regexp/testdata/gen.txtar @@ -23,9 +23,9 @@ t14: regexp.ReplaceAll(#"f(?P\w)(?P\w)"#, "afloat afoot from", "-$1-$2-") t15: regexp.ReplaceAllLiteral(#"f(?P\w)(?P\w)"#, "afloat afoot from", "-${A}-${B}-") t16: regexp.ReplaceAllLiteral(#"f(?P\w)(?P\w)"#, "afloat afoot from", "-$1-$2-") --- out/regexp -- +-- out/regexp-v3 -- Errors: -t13: invalid value "invalid)" (does not satisfy regexp.Valid): error in call to regexp.Valid: error parsing regexp: unexpected ): `invalid)`: +t13: invalid value "invalid)" (does not satisfy regexp.Valid): error parsing regexp: unexpected ): `invalid)`: ./in.cue:15:6 ./in.cue:15:21 t2: error in call to regexp.Find: no match: @@ -64,7 +64,7 @@ t10: [{ }] t11: _|_ // t11: error in call to regexp.FindAllNamedSubmatch: no match t12: "valid" -t13: _|_ // t13: invalid value "invalid)" (does not satisfy regexp.Valid): t13: error in call to regexp.Valid: error parsing regexp: unexpected ): `invalid)` +t13: _|_ // t13: invalid value "invalid)" (does not satisfy regexp.Valid): error parsing regexp: unexpected ): `invalid)` // The following two calls should be identical t14: "a-l-o-at a-o-o-t -r-o-m" diff --git a/pkg/strings/testdata/gen.txtar b/pkg/strings/testdata/gen.txtar index c1627f3a6..4a86025cd 100644 --- a/pkg/strings/testdata/gen.txtar +++ b/pkg/strings/testdata/gen.txtar @@ -20,9 +20,9 @@ t14: strings.MinRunes(3) & "hello" t15: strings.MaxRunes(10) & "hello" t16: strings.MaxRunes(3) & "hello" t17: strings.MinRunes(10) & "hello" --- out/strings -- +-- out/strings-v3 -- Errors: -t2: invalid list element 0 in argument 0 to call: cannot use value 1 (int) as string: +t2: error in call to strings.Join: invalid list element 0 in argument 0 to call: cannot use value 1 (int) as string: ./in.cue:4:6 ./in.cue:4:20 t10: invalid value "quux" (does not satisfy strings.MaxRunes(3)): @@ -44,7 +44,7 @@ t17: invalid value "hello" (does not satisfy strings.MinRunes(10)): Result: t1: "Hello World!" -t2: _|_ // t2: invalid list element 0 in argument 0 to call: cannot use value 1 (int) as string +t2: _|_ // t2: error in call to strings.Join: t2: invalid list element 0 in argument 0 to call: cannot use value 1 (int) as string t3: 97 t4: 'llo' t5: "✓ H" diff --git a/pkg/time/testdata/gen.txtar b/pkg/time/testdata/gen.txtar index 0b89a35b6..444a61028 100644 --- a/pkg/time/testdata/gen.txtar +++ b/pkg/time/testdata/gen.txtar @@ -24,15 +24,15 @@ parse: { split: { t1: time.Split("2017-07-14T02:40:00.000123456Z") } --- out/time -- +-- out/time-v3 -- Errors: -t2: invalid value "no time" (does not satisfy time.Time): error in call to time.Time: invalid time "no time": +t2: invalid value "no time" (does not satisfy time.Time): invalid time "no time": ./in.cue:4:5 ./in.cue:4:17 Result: t1: "1937-01-01T12:00:27.87+00:20" -t2: _|_ // t2: invalid value "no time" (does not satisfy time.Time): t2: error in call to time.Time: invalid time "no time" +t2: _|_ // t2: invalid value "no time" (does not satisfy time.Time): invalid time "no time" t3: "2017-07-14T02:40:00.000123456Z" parse: { t1: "2021-07-01T17:54:00Z"