this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

internal/core/adt: add tests cases for new closedness

These are all test cases that were discovered during
development of the new closedness algorithm and
by evaluating against Unity.

- exclude.txtar:
ensure that for hidden fields, lets, and definitions,
typo checking is turned off within them when they
are not part of a schema.

- root*:
problems that only occur when at the root of a file.

- typocheck: issues uncovered with Unity etc.

Signed-off-by: Marcel van Lohuizen <mpvl@gmail.com>
Change-Id: I9cf316f7325d990e7742e186056665998494ad90
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1211386
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Matthew Sackman <matthew@cue.works>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>

+2690
+582
cue/testdata/definitions/exclude.txtar
··· 1 + -- in.cue -- 2 + package p 3 + 4 + excludeLet: { 5 + // Two lets with the same name should not unify and checked by definition. 6 + #D: { let X = {}, #foo: X, f: _ } 7 + a: #D 8 + a: { let X = { a: 1 }, f: X } 9 + } 10 + 11 + definition: { 12 + // Check a definition only if it s contained withing a definition. 13 + err1: { 14 + #D: { #foo: a: int } 15 + a: #D 16 + a: { #foo: b: int } 17 + } 18 + ok1: { 19 + #D: {} 20 + a: #D 21 + a: { #foo: b: int } 22 + } 23 + } 24 + 25 + hidden: { 26 + // Check a hidden field only if it s contained withing a definition. 27 + err1: { 28 + #D: { _foo: a: int } 29 + a: #D 30 + a: { _foo: b: int } 31 + } 32 + ok1: { 33 + #D: {} 34 + a: #D 35 + a: { _foo: b: int } 36 + } 37 + } 38 + -- regress.cue -- 39 + package p 40 + 41 + import "encoding/json" 42 + 43 + definition: ok1: { 44 + org: #Org & { 45 + #Employee: username: string 46 + } 47 + #Org: employees?: [string]: username!: string 48 + } 49 + 50 + definition: ok2: { 51 + #Tree: { 52 + #Leaf: leaf: string 53 + #Branch: branch?: #Leaf 54 + root: #Branch 55 + } 56 + out: json.Marshal(#Tree & {root: {}}) 57 + } 58 + 59 + hidden: ok1: { 60 + out: #Workflow & { 61 + _hidden: #step & { 62 + run: "foo bar" 63 + } 64 + } 65 + #Workflow: { 66 + } 67 + #step: matchN(1, [{ 68 + "run"!: _ 69 + }]) 70 + } 71 + -- out/eval/stats -- 72 + Leaks: 1 73 + Freed: 78 74 + Reused: 70 75 + Allocs: 9 76 + Retain: 7 77 + 78 + Unifications: 79 79 + Conjuncts: 120 80 + Disjuncts: 85 81 + -- out/evalalpha -- 82 + Errors: 83 + definition.err1.a.#foo.b: field not allowed: 84 + ./in.cue:15:14 85 + hidden.err1.a._foo.b: field not allowed: 86 + ./in.cue:29:14 87 + 88 + Result: 89 + (_|_){ 90 + // [eval] 91 + excludeLet: (struct){ 92 + #D: (#struct){ 93 + let X#1 = (#struct){ 94 + } 95 + #foo: (#struct){ 96 + } 97 + f: (_){ _ } 98 + } 99 + a: (#struct){ 100 + let X#2 = (struct){ 101 + a: (int){ 1 } 102 + } 103 + f: (#struct){ 104 + a: (int){ 1 } 105 + } 106 + let X#1 = (#struct){ 107 + } 108 + #foo: (#struct){ 109 + } 110 + } 111 + } 112 + definition: (_|_){ 113 + // [eval] 114 + err1: (_|_){ 115 + // [eval] 116 + #D: (#struct){ 117 + #foo: (#struct){ 118 + a: (int){ int } 119 + } 120 + } 121 + a: (_|_){ 122 + // [eval] 123 + #foo: (_|_){ 124 + // [eval] 125 + b: (_|_){ 126 + // [eval] definition.err1.a.#foo.b: field not allowed: 127 + // ./in.cue:15:14 128 + } 129 + a: (int){ int } 130 + } 131 + } 132 + } 133 + ok1: (struct){ 134 + #D: (#struct){ 135 + } 136 + a: (#struct){ 137 + #foo: (#struct){ 138 + b: (int){ int } 139 + } 140 + } 141 + org: (#struct){ 142 + #Employee: (#struct){ 143 + username: (string){ string } 144 + } 145 + employees?: (#struct){ 146 + } 147 + } 148 + #Org: (#struct){ 149 + employees?: (#struct){ 150 + } 151 + } 152 + } 153 + ok2: (struct){ 154 + #Tree: (#struct){ 155 + #Leaf: (#struct){ 156 + leaf: (string){ string } 157 + } 158 + #Branch: (#struct){ 159 + branch?: ~(definition.ok2.#Tree.#Leaf) 160 + } 161 + root: ~(definition.ok2.#Tree.#Branch) 162 + } 163 + out: (string){ "{\"root\":{}}" } 164 + } 165 + } 166 + hidden: (_|_){ 167 + // [eval] 168 + err1: (_|_){ 169 + // [eval] 170 + #D: (#struct){ 171 + _foo(:p): (#struct){ 172 + a: (int){ int } 173 + } 174 + } 175 + a: (_|_){ 176 + // [eval] 177 + _foo(:p): (_|_){ 178 + // [eval] 179 + b: (_|_){ 180 + // [eval] hidden.err1.a._foo.b: field not allowed: 181 + // ./in.cue:29:14 182 + } 183 + a: (int){ int } 184 + } 185 + } 186 + } 187 + ok1: (struct){ 188 + #D: (#struct){ 189 + } 190 + a: (#struct){ 191 + _foo(:p): (struct){ 192 + b: (int){ int } 193 + } 194 + } 195 + out: (#struct){ 196 + _hidden(:p): (#struct){ 197 + run: (string){ "foo bar" } 198 + } 199 + } 200 + #Workflow: (#struct){ 201 + } 202 + #step: (_){ matchN(1, (#list){ 203 + 0: (_|_){// { 204 + // run!: _ 205 + // } 206 + } 207 + }) } 208 + } 209 + } 210 + } 211 + -- diff/-out/evalalpha<==>+out/eval -- 212 + diff old new 213 + --- old 214 + +++ new 215 + @@ -1,11 +1,7 @@ 216 + Errors: 217 + definition.err1.a.#foo.b: field not allowed: 218 + - ./in.cue:13:15 219 + - ./in.cue:14:6 220 + ./in.cue:15:14 221 + hidden.err1.a._foo.b: field not allowed: 222 + - ./in.cue:27:15 223 + - ./in.cue:28:6 224 + ./in.cue:29:14 225 + 226 + Result: 227 + @@ -20,16 +16,16 @@ 228 + f: (_){ _ } 229 + } 230 + a: (#struct){ 231 + - let X#1 = (#struct){ 232 + - } 233 + - #foo: (#struct){ 234 + - } 235 + - f: (struct){ 236 + - a: (int){ 1 } 237 + - } 238 + let X#2 = (struct){ 239 + a: (int){ 1 } 240 + } 241 + + f: (#struct){ 242 + + a: (int){ 1 } 243 + + } 244 + + let X#1 = (#struct){ 245 + + } 246 + + #foo: (#struct){ 247 + + } 248 + } 249 + } 250 + definition: (_|_){ 251 + @@ -45,13 +41,11 @@ 252 + // [eval] 253 + #foo: (_|_){ 254 + // [eval] 255 + - a: (int){ int } 256 + b: (_|_){ 257 + // [eval] definition.err1.a.#foo.b: field not allowed: 258 + - // ./in.cue:13:15 259 + - // ./in.cue:14:6 260 + // ./in.cue:15:14 261 + } 262 + + a: (int){ int } 263 + } 264 + } 265 + } 266 + @@ -64,11 +58,11 @@ 267 + } 268 + } 269 + org: (#struct){ 270 + - employees?: (#struct){ 271 + - } 272 + #Employee: (#struct){ 273 + username: (string){ string } 274 + } 275 + + employees?: (#struct){ 276 + + } 277 + } 278 + #Org: (#struct){ 279 + employees?: (#struct){ 280 + @@ -81,15 +75,9 @@ 281 + leaf: (string){ string } 282 + } 283 + #Branch: (#struct){ 284 + - branch?: (#struct){ 285 + - leaf: (string){ string } 286 + - } 287 + - } 288 + - root: (#struct){ 289 + - branch?: (#struct){ 290 + - leaf: (string){ string } 291 + - } 292 + - } 293 + + branch?: ~(definition.ok2.#Tree.#Leaf) 294 + + } 295 + + root: ~(definition.ok2.#Tree.#Branch) 296 + } 297 + out: (string){ "{\"root\":{}}" } 298 + } 299 + @@ -107,13 +95,11 @@ 300 + // [eval] 301 + _foo(:p): (_|_){ 302 + // [eval] 303 + - a: (int){ int } 304 + b: (_|_){ 305 + // [eval] hidden.err1.a._foo.b: field not allowed: 306 + - // ./in.cue:27:15 307 + - // ./in.cue:28:6 308 + // ./in.cue:29:14 309 + } 310 + + a: (int){ int } 311 + } 312 + } 313 + } 314 + @@ -126,7 +112,7 @@ 315 + } 316 + } 317 + out: (#struct){ 318 + - _hidden(:p): (struct){ 319 + + _hidden(:p): (#struct){ 320 + run: (string){ "foo bar" } 321 + } 322 + } 323 + -- out/eval -- 324 + Errors: 325 + definition.err1.a.#foo.b: field not allowed: 326 + ./in.cue:13:15 327 + ./in.cue:14:6 328 + ./in.cue:15:14 329 + hidden.err1.a._foo.b: field not allowed: 330 + ./in.cue:27:15 331 + ./in.cue:28:6 332 + ./in.cue:29:14 333 + 334 + Result: 335 + (_|_){ 336 + // [eval] 337 + excludeLet: (struct){ 338 + #D: (#struct){ 339 + let X#1 = (#struct){ 340 + } 341 + #foo: (#struct){ 342 + } 343 + f: (_){ _ } 344 + } 345 + a: (#struct){ 346 + let X#1 = (#struct){ 347 + } 348 + #foo: (#struct){ 349 + } 350 + f: (struct){ 351 + a: (int){ 1 } 352 + } 353 + let X#2 = (struct){ 354 + a: (int){ 1 } 355 + } 356 + } 357 + } 358 + definition: (_|_){ 359 + // [eval] 360 + err1: (_|_){ 361 + // [eval] 362 + #D: (#struct){ 363 + #foo: (#struct){ 364 + a: (int){ int } 365 + } 366 + } 367 + a: (_|_){ 368 + // [eval] 369 + #foo: (_|_){ 370 + // [eval] 371 + a: (int){ int } 372 + b: (_|_){ 373 + // [eval] definition.err1.a.#foo.b: field not allowed: 374 + // ./in.cue:13:15 375 + // ./in.cue:14:6 376 + // ./in.cue:15:14 377 + } 378 + } 379 + } 380 + } 381 + ok1: (struct){ 382 + #D: (#struct){ 383 + } 384 + a: (#struct){ 385 + #foo: (#struct){ 386 + b: (int){ int } 387 + } 388 + } 389 + org: (#struct){ 390 + employees?: (#struct){ 391 + } 392 + #Employee: (#struct){ 393 + username: (string){ string } 394 + } 395 + } 396 + #Org: (#struct){ 397 + employees?: (#struct){ 398 + } 399 + } 400 + } 401 + ok2: (struct){ 402 + #Tree: (#struct){ 403 + #Leaf: (#struct){ 404 + leaf: (string){ string } 405 + } 406 + #Branch: (#struct){ 407 + branch?: (#struct){ 408 + leaf: (string){ string } 409 + } 410 + } 411 + root: (#struct){ 412 + branch?: (#struct){ 413 + leaf: (string){ string } 414 + } 415 + } 416 + } 417 + out: (string){ "{\"root\":{}}" } 418 + } 419 + } 420 + hidden: (_|_){ 421 + // [eval] 422 + err1: (_|_){ 423 + // [eval] 424 + #D: (#struct){ 425 + _foo(:p): (#struct){ 426 + a: (int){ int } 427 + } 428 + } 429 + a: (_|_){ 430 + // [eval] 431 + _foo(:p): (_|_){ 432 + // [eval] 433 + a: (int){ int } 434 + b: (_|_){ 435 + // [eval] hidden.err1.a._foo.b: field not allowed: 436 + // ./in.cue:27:15 437 + // ./in.cue:28:6 438 + // ./in.cue:29:14 439 + } 440 + } 441 + } 442 + } 443 + ok1: (struct){ 444 + #D: (#struct){ 445 + } 446 + a: (#struct){ 447 + _foo(:p): (struct){ 448 + b: (int){ int } 449 + } 450 + } 451 + out: (#struct){ 452 + _hidden(:p): (struct){ 453 + run: (string){ "foo bar" } 454 + } 455 + } 456 + #Workflow: (#struct){ 457 + } 458 + #step: (_){ matchN(1, (#list){ 459 + 0: (_|_){// { 460 + // run!: _ 461 + // } 462 + } 463 + }) } 464 + } 465 + } 466 + } 467 + -- out/compile -- 468 + --- in.cue 469 + { 470 + excludeLet: { 471 + #D: { 472 + let X#1 = {} 473 + #foo: 〈0;let X#1〉 474 + f: _ 475 + } 476 + a: 〈0;#D〉 477 + a: { 478 + let X#2 = { 479 + a: 1 480 + } 481 + f: 〈0;let X#2〉 482 + } 483 + } 484 + definition: { 485 + err1: { 486 + #D: { 487 + #foo: { 488 + a: int 489 + } 490 + } 491 + a: 〈0;#D〉 492 + a: { 493 + #foo: { 494 + b: int 495 + } 496 + } 497 + } 498 + ok1: { 499 + #D: {} 500 + a: 〈0;#D〉 501 + a: { 502 + #foo: { 503 + b: int 504 + } 505 + } 506 + } 507 + } 508 + hidden: { 509 + err1: { 510 + #D: { 511 + _foo: { 512 + a: int 513 + } 514 + } 515 + a: 〈0;#D〉 516 + a: { 517 + _foo: { 518 + b: int 519 + } 520 + } 521 + } 522 + ok1: { 523 + #D: {} 524 + a: 〈0;#D〉 525 + a: { 526 + _foo: { 527 + b: int 528 + } 529 + } 530 + } 531 + } 532 + } 533 + --- regress.cue 534 + { 535 + definition: { 536 + ok1: { 537 + org: (〈0;#Org〉 & { 538 + #Employee: { 539 + username: string 540 + } 541 + }) 542 + #Org: { 543 + employees?: { 544 + [string]: { 545 + username!: string 546 + } 547 + } 548 + } 549 + } 550 + } 551 + definition: { 552 + ok2: { 553 + #Tree: { 554 + #Leaf: { 555 + leaf: string 556 + } 557 + #Branch: { 558 + branch?: 〈1;#Leaf〉 559 + } 560 + root: 〈0;#Branch〉 561 + } 562 + out: 〈import;"encoding/json"〉.Marshal((〈0;#Tree〉 & { 563 + root: {} 564 + })) 565 + } 566 + } 567 + hidden: { 568 + ok1: { 569 + out: (〈0;#Workflow〉 & { 570 + _hidden: (〈1;#step〉 & { 571 + run: "foo bar" 572 + }) 573 + }) 574 + #Workflow: {} 575 + #step: matchN(1, [ 576 + { 577 + run!: _ 578 + }, 579 + ]) 580 + } 581 + } 582 + }
+34
cue/testdata/definitions/root1.txtar
··· 1 + -- in.cue -- 2 + // Test embedding at root of file 3 + root1: 1 4 + #Root1: x: {} 5 + #Root1 & { } 6 + -- out/eval/stats -- 7 + Leaks: 0 8 + Freed: 5 9 + Reused: 2 10 + Allocs: 3 11 + Retain: 1 12 + 13 + Unifications: 5 14 + Conjuncts: 8 15 + Disjuncts: 6 16 + -- out/eval -- 17 + (#struct){ 18 + root1: (int){ 1 } 19 + #Root1: (#struct){ 20 + x: (#struct){ 21 + } 22 + } 23 + x: (#struct){ 24 + } 25 + } 26 + -- out/compile -- 27 + --- in.cue 28 + { 29 + root1: 1 30 + #Root1: { 31 + x: {} 32 + } 33 + (〈0;#Root1〉 & {}) 34 + }
+27
cue/testdata/definitions/root2.txtar
··· 1 + -- in.cue -- 2 + root2: 1 3 + #Root2: {} 4 + #Root2 5 + -- out/eval/stats -- 6 + Leaks: 0 7 + Freed: 3 8 + Reused: 0 9 + Allocs: 3 10 + Retain: 1 11 + 12 + Unifications: 3 13 + Conjuncts: 5 14 + Disjuncts: 4 15 + -- out/eval -- 16 + (#struct){ 17 + root2: (int){ 1 } 18 + #Root2: (#struct){ 19 + } 20 + } 21 + -- out/compile -- 22 + --- in.cue 23 + { 24 + root2: 1 25 + #Root2: {} 26 + 〈0;#Root2〉 27 + }
+33
cue/testdata/definitions/root3.txtar
··· 1 + -- in.cue -- 2 + x: _ 3 + #D: b: x 4 + #D & { b: _ } 5 + -- out/eval/stats -- 6 + Leaks: 0 7 + Freed: 5 8 + Reused: 2 9 + Allocs: 3 10 + Retain: 1 11 + 12 + Unifications: 5 13 + Conjuncts: 11 14 + Disjuncts: 6 15 + -- out/eval -- 16 + (#struct){ 17 + x: (_){ _ } 18 + #D: (#struct){ 19 + b: (_){ _ } 20 + } 21 + b: (_){ _ } 22 + } 23 + -- out/compile -- 24 + --- in.cue 25 + { 26 + x: _ 27 + #D: { 28 + b: 〈1;x〉 29 + } 30 + (〈0;#D〉 & { 31 + b: _ 32 + }) 33 + }
+117
cue/testdata/definitions/root4.txtar
··· 1 + -- in.cue -- 2 + #schema: a!: bool 3 + _hidden & #schema // must fail here, but not elsewhere 4 + _hidden: { 5 + "a": true, 6 + notAllowed: true 7 + } 8 + allowed: true 9 + -- out/eval/stats -- 10 + Leaks: 0 11 + Freed: 9 12 + Reused: 5 13 + Allocs: 4 14 + Retain: 2 15 + 16 + Unifications: 9 17 + Conjuncts: 15 18 + Disjuncts: 11 19 + -- out/evalalpha -- 20 + Errors: 21 + notAllowed: field not allowed: 22 + ./in.cue:5:2 23 + 24 + Result: 25 + (_|_){ 26 + // [eval] 27 + #schema: (#struct){ 28 + a!: (bool){ bool } 29 + } 30 + _hidden: (struct){ 31 + a: (bool){ true } 32 + notAllowed: (bool){ true } 33 + } 34 + allowed: (bool){ true } 35 + a: (bool){ true } 36 + notAllowed: (_|_){ 37 + // [eval] notAllowed: field not allowed: 38 + // ./in.cue:5:2 39 + } 40 + } 41 + -- diff/-out/evalalpha<==>+out/eval -- 42 + diff old new 43 + --- old 44 + +++ new 45 + @@ -1,9 +1,5 @@ 46 + Errors: 47 + notAllowed: field not allowed: 48 + - ./in.cue:1:1 49 + - ./in.cue:1:10 50 + - ./in.cue:2:1 51 + - ./in.cue:2:11 52 + ./in.cue:5:2 53 + 54 + Result: 55 + @@ -12,18 +8,14 @@ 56 + #schema: (#struct){ 57 + a!: (bool){ bool } 58 + } 59 + - a: (bool){ true } 60 + _hidden: (struct){ 61 + a: (bool){ true } 62 + notAllowed: (bool){ true } 63 + } 64 + allowed: (bool){ true } 65 + + a: (bool){ true } 66 + notAllowed: (_|_){ 67 + // [eval] notAllowed: field not allowed: 68 + - // ./in.cue:1:1 69 + - // ./in.cue:1:10 70 + - // ./in.cue:2:1 71 + - // ./in.cue:2:11 72 + // ./in.cue:5:2 73 + } 74 + } 75 + -- out/eval -- 76 + Errors: 77 + notAllowed: field not allowed: 78 + ./in.cue:1:1 79 + ./in.cue:1:10 80 + ./in.cue:2:1 81 + ./in.cue:2:11 82 + ./in.cue:5:2 83 + 84 + Result: 85 + (_|_){ 86 + // [eval] 87 + #schema: (#struct){ 88 + a!: (bool){ bool } 89 + } 90 + a: (bool){ true } 91 + _hidden: (struct){ 92 + a: (bool){ true } 93 + notAllowed: (bool){ true } 94 + } 95 + allowed: (bool){ true } 96 + notAllowed: (_|_){ 97 + // [eval] notAllowed: field not allowed: 98 + // ./in.cue:1:1 99 + // ./in.cue:1:10 100 + // ./in.cue:2:1 101 + // ./in.cue:2:11 102 + // ./in.cue:5:2 103 + } 104 + } 105 + -- out/compile -- 106 + --- in.cue 107 + { 108 + #schema: { 109 + a!: bool 110 + } 111 + (〈0;_hidden〉 & 〈0;#schema〉) 112 + _hidden: { 113 + a: true 114 + notAllowed: true 115 + } 116 + allowed: true 117 + }
+1897
cue/testdata/definitions/typocheck.txtar
··· 1 + -- in.cue -- 2 + embed: simple: { 3 + #A: b: 1 4 + a: { #A } 5 + a: err: 1 6 + } 7 + embed: andInStruct: { 8 + #Foo: a: int 9 + a: { #Foo & { err: 2 } } 10 + } 11 + embed: embedDefWithEmbedding: { 12 + #Foo: {{a: int}} 13 + a: { #Foo & { err: 2 } } // not allowed 14 + } 15 + embed: embedComprehension: { 16 + #Foo: {if true {a: int}} 17 + a: { #Foo & { err: 2 } } // not allowed 18 + } 19 + embed: fieldWithAnd: { 20 + #A: {} 21 + { a: #A & {err: 3} } 22 + } 23 + embed: embedAndRecursive: { 24 + #A: a: int 25 + B: x: #A 26 + B & { x: err: 2 } 27 + } 28 + embed: andEmbed: { 29 + #A: b: int 30 + #B: b: int 31 + #D: {#A & #B} 32 + d: #D & {err: 3} 33 + } 34 + and: transitive: { 35 + Z: a: string 36 + #Y: Z 37 + #X: #Y & Z 38 + out: #X & { 39 + ok: "foo" 40 + } 41 + } 42 + and: transitiveWithEmbed: { 43 + Z: a: string 44 + #X: #Y & Z 45 + #Y: {Z} 46 + out: #X & { 47 + ok: "foo" 48 + } 49 + } 50 + embed: nonDef: t1: { 51 + X: a: string 52 + #Y: #Z & X 53 + #Z: { 54 + X 55 + b?: string 56 + } 57 + } 58 + embed: defAndHidden: full: { 59 + _stepCommon: Name: string 60 + #Step: #Command & _stepCommon 61 + #Command: { 62 + _stepCommon 63 + Path?: string 64 + } 65 + out: #Step & { 66 + Name: "foo" 67 + } 68 + } 69 + -- validators.cue -- 70 + import "struct" 71 + embed: normalValidator: { 72 + #X: { 73 + struct.MaxFields(1) 74 + a?: int 75 + b?: int 76 + } 77 + x: #X 78 + x: err: 1 79 + } 80 + embed: openValidator: t1: { 81 + #X: { 82 + matchN(0, []) 83 + a?: int 84 + b?: int 85 + } 86 + x: #X 87 + x: err: 1 88 + } 89 + embed: openValidator: t2: { 90 + Y: matchN(1, [X]) 91 + X: b?: Y 92 + a: X 93 + a: b: 1 94 + } 95 + 96 + -- large.cue -- 97 + full: { 98 + #Resource: { 99 + someMsg: string 100 + obs: {} | *{missing: true} 101 + 102 + let pickMsg = [ 103 + if obs.missing {msg: "\(someMsg)"}, 104 + {msg: "bar"}, 105 + ][0] 106 + patches: [{ 107 + op: "add" 108 + path: "/metadata" 109 + value: pickMsg.msg 110 + }] 111 + } 112 + 113 + #Patches: [string]: _ 114 + #JSONPatch: { 115 + namespace?: string 116 + patch: [...#JSONOp] 117 + output: #Patches & {(namespace): patch} 118 + } 119 + #JSONOp: { 120 + op: "add" 121 + path: string 122 + value: _ 123 + } | { 124 + op: "remove" 125 + path: string 126 + } 127 + 128 + #Main: { 129 + NS=namespace: string 130 + 131 + output: jsonPatch.output 132 + 133 + let jsonPatch = #JSONPatch & { 134 + let base = #Resource & {} 135 + let withMsg = base & {someMsg: "foo"} 136 + 137 + namespace: NS 138 + 139 + patch: withMsg.patches 140 + } 141 + } 142 + out: (#Main & {namespace: "ns1"}).output 143 + } 144 + -- out/evalalpha/stats -- 145 + Leaks: 111 146 + Freed: 0 147 + Reused: 0 148 + Allocs: 111 149 + Retain: 0 150 + 151 + Unifications: 78 152 + Conjuncts: 141 153 + Disjuncts: 12 154 + -- diff/-out/evalalpha/stats<==>+out/eval/stats -- 155 + diff old new 156 + --- old 157 + +++ new 158 + @@ -1,9 +1,9 @@ 159 + -Leaks: 12 160 + -Freed: 160 161 + -Reused: 150 162 + -Allocs: 22 163 + -Retain: 20 164 + +Leaks: 111 165 + +Freed: 0 166 + +Reused: 0 167 + +Allocs: 111 168 + +Retain: 0 169 + 170 + -Unifications: 146 171 + -Conjuncts: 331 172 + -Disjuncts: 179 173 + +Unifications: 78 174 + +Conjuncts: 141 175 + +Disjuncts: 12 176 + -- out/eval/stats -- 177 + Leaks: 15 178 + Freed: 284 179 + Reused: 273 180 + Allocs: 26 181 + Retain: 29 182 + 183 + Unifications: 273 184 + Conjuncts: 581 185 + Disjuncts: 312 186 + -- out/evalalpha -- 187 + Errors: 188 + embed.openValidator.t2.a.b: conflicting values 1 and {b?:Y} (mismatched types int and struct): 189 + ./validators.cue:22:5 190 + ./validators.cue:24:8 191 + embed.simple.a.err: field not allowed: 192 + ./in.cue:3:7 193 + ./in.cue:4:5 194 + embed.andInStruct.a.err: field not allowed: 195 + ./in.cue:8:7 196 + ./in.cue:8:16 197 + embed.embedDefWithEmbedding.a.err: field not allowed: 198 + ./in.cue:12:7 199 + ./in.cue:12:16 200 + embed.embedComprehension.a.err: field not allowed: 201 + ./in.cue:15:21 202 + ./in.cue:16:16 203 + embed.fieldWithAnd.a.err: field not allowed: 204 + ./in.cue:20:7 205 + ./in.cue:20:13 206 + embed.embedAndRecursive.x.err: field not allowed: 207 + ./in.cue:24:8 208 + ./in.cue:25:11 209 + embed.andEmbed.d.err: field not allowed: 210 + ./in.cue:30:12 211 + ./in.cue:31:11 212 + and.transitive.out.ok: field not allowed: 213 + ./in.cue:35:6 214 + ./in.cue:38:3 215 + and.transitiveWithEmbed.out.ok: field not allowed: 216 + ./in.cue:44:7 217 + ./in.cue:46:3 218 + embed.normalValidator.x.err: field not allowed: 219 + ./validators.cue:4:3 220 + ./validators.cue:9:5 221 + embed.openValidator.t2.a.b: invalid value 1 (does not satisfy matchN): 0 matched, expected 1: 222 + ./validators.cue:21:5 223 + ./validators.cue:21:12 224 + ./validators.cue:22:9 225 + ./validators.cue:24:8 226 + 227 + Result: 228 + (_|_){ 229 + // [eval] 230 + embed: (_|_){ 231 + // [eval] 232 + simple: (_|_){ 233 + // [eval] 234 + #A: (#struct){ 235 + b: (int){ 1 } 236 + } 237 + a: (_|_){ 238 + // [eval] 239 + err: (_|_){ 240 + // [eval] embed.simple.a.err: field not allowed: 241 + // ./in.cue:3:7 242 + // ./in.cue:4:5 243 + } 244 + b: (int){ 1 } 245 + } 246 + } 247 + andInStruct: (_|_){ 248 + // [eval] 249 + #Foo: (#struct){ 250 + a: (int){ int } 251 + } 252 + a: (_|_){ 253 + // [eval] 254 + err: (_|_){ 255 + // [eval] embed.andInStruct.a.err: field not allowed: 256 + // ./in.cue:8:7 257 + // ./in.cue:8:16 258 + } 259 + a: (int){ int } 260 + } 261 + } 262 + embedDefWithEmbedding: (_|_){ 263 + // [eval] 264 + #Foo: (#struct){ 265 + a: (int){ int } 266 + } 267 + a: (_|_){ 268 + // [eval] 269 + err: (_|_){ 270 + // [eval] embed.embedDefWithEmbedding.a.err: field not allowed: 271 + // ./in.cue:12:7 272 + // ./in.cue:12:16 273 + } 274 + a: (int){ int } 275 + } 276 + } 277 + embedComprehension: (_|_){ 278 + // [eval] 279 + #Foo: (#struct){ 280 + a: (int){ int } 281 + } 282 + a: (_|_){ 283 + // [eval] 284 + err: (_|_){ 285 + // [eval] embed.embedComprehension.a.err: field not allowed: 286 + // ./in.cue:15:21 287 + // ./in.cue:16:16 288 + } 289 + a: (int){ int } 290 + } 291 + } 292 + fieldWithAnd: (_|_){ 293 + // [eval] 294 + #A: (#struct){ 295 + } 296 + a: (_|_){ 297 + // [eval] 298 + err: (_|_){ 299 + // [eval] embed.fieldWithAnd.a.err: field not allowed: 300 + // ./in.cue:20:7 301 + // ./in.cue:20:13 302 + } 303 + } 304 + } 305 + embedAndRecursive: (_|_){ 306 + // [eval] 307 + #A: (#struct){ 308 + a: (int){ int } 309 + } 310 + B: (struct){ 311 + x: ~(embed.embedAndRecursive.#A) 312 + } 313 + x: (_|_){ 314 + // [eval] 315 + err: (_|_){ 316 + // [eval] embed.embedAndRecursive.x.err: field not allowed: 317 + // ./in.cue:24:8 318 + // ./in.cue:25:11 319 + } 320 + a: (int){ int } 321 + } 322 + } 323 + andEmbed: (_|_){ 324 + // [eval] 325 + #A: (#struct){ 326 + b: (int){ int } 327 + } 328 + #B: (#struct){ 329 + b: (int){ int } 330 + } 331 + #D: (#struct){ 332 + b: (int){ int } 333 + } 334 + d: (_|_){ 335 + // [eval] 336 + err: (_|_){ 337 + // [eval] embed.andEmbed.d.err: field not allowed: 338 + // ./in.cue:30:12 339 + // ./in.cue:31:11 340 + } 341 + b: (int){ int } 342 + } 343 + } 344 + nonDef: (struct){ 345 + t1: (struct){ 346 + X: (struct){ 347 + a: (string){ string } 348 + } 349 + #Y: (#struct){ 350 + b?: (string){ string } 351 + a: (string){ string } 352 + } 353 + #Z: (#struct){ 354 + b?: (string){ string } 355 + a: (string){ string } 356 + } 357 + } 358 + } 359 + defAndHidden: (struct){ 360 + full: (struct){ 361 + _stepCommon: (struct){ 362 + Name: (string){ string } 363 + } 364 + #Step: (#struct){ 365 + Path?: (string){ string } 366 + Name: (string){ string } 367 + } 368 + #Command: (#struct){ 369 + Path?: (string){ string } 370 + Name: (string){ string } 371 + } 372 + out: (#struct){ 373 + Name: (string){ "foo" } 374 + Path?: (string){ string } 375 + } 376 + } 377 + } 378 + normalValidator: (_|_){ 379 + // [eval] 380 + #X: (#struct){ 381 + a?: (int){ int } 382 + b?: (int){ int } 383 + } 384 + x: (_|_){ 385 + // [eval] embed.normalValidator.x.err: field not allowed: 386 + // ./validators.cue:4:3 387 + // ./validators.cue:9:5 388 + err: (_|_){ 389 + // [eval] embed.normalValidator.x.err: field not allowed: 390 + // ./validators.cue:4:3 391 + // ./validators.cue:9:5 392 + } 393 + a?: (int){ int } 394 + b?: (int){ int } 395 + } 396 + } 397 + openValidator: (_|_){ 398 + // [eval] 399 + t1: (struct){ 400 + #X: (_){ 401 + matchN(0, (#list){ 402 + }) 403 + a?: (int){ int } 404 + b?: (int){ int } 405 + } 406 + x: (#struct){ 407 + err: (int){ 1 } 408 + a?: (int){ int } 409 + b?: (int){ int } 410 + } 411 + } 412 + t2: (_|_){ 413 + // [eval] 414 + Y: (_){ matchN(1, (#list){ 415 + 0: (_|_){// 〈1;X〉 416 + } 417 + }) } 418 + X: (struct){ 419 + b?: (_){ matchN(1, (#list){ 420 + 0: (_|_){// 〈1;X〉 421 + } 422 + }) } 423 + } 424 + a: (_|_){ 425 + // [eval] 426 + b: (_|_){ 427 + // [eval] embed.openValidator.t2.a.b: conflicting values 1 and {b?:Y} (mismatched types int and struct): 428 + // ./validators.cue:22:5 429 + // ./validators.cue:24:8 430 + // embed.openValidator.t2.a.b: invalid value 1 (does not satisfy matchN): 0 matched, expected 1: 431 + // ./validators.cue:21:5 432 + // ./validators.cue:21:12 433 + // ./validators.cue:22:9 434 + // ./validators.cue:24:8 435 + } 436 + } 437 + } 438 + } 439 + } 440 + and: (_|_){ 441 + // [eval] 442 + transitive: (_|_){ 443 + // [eval] 444 + Z: (struct){ 445 + a: (string){ string } 446 + } 447 + #Y: (#struct){ 448 + a: (string){ string } 449 + } 450 + #X: (#struct){ 451 + a: (string){ string } 452 + } 453 + out: (_|_){ 454 + // [eval] 455 + ok: (_|_){ 456 + // [eval] and.transitive.out.ok: field not allowed: 457 + // ./in.cue:35:6 458 + // ./in.cue:38:3 459 + } 460 + a: (string){ string } 461 + } 462 + } 463 + transitiveWithEmbed: (_|_){ 464 + // [eval] 465 + Z: (struct){ 466 + a: (string){ string } 467 + } 468 + #X: (#struct){ 469 + a: (string){ string } 470 + } 471 + #Y: (#struct){ 472 + a: (string){ string } 473 + } 474 + out: (_|_){ 475 + // [eval] 476 + ok: (_|_){ 477 + // [eval] and.transitiveWithEmbed.out.ok: field not allowed: 478 + // ./in.cue:44:7 479 + // ./in.cue:46:3 480 + } 481 + a: (string){ string } 482 + } 483 + } 484 + } 485 + full: (struct){ 486 + #Resource: (#struct){ 487 + someMsg: (string){ string } 488 + obs: (#struct){ |(*(#struct){ 489 + missing: (bool){ true } 490 + }, (#struct){ 491 + }) } 492 + let pickMsg#1 = (#struct){ 493 + msg: (_|_){ 494 + // [incomplete] full.#Resource.pickMsg.msg: invalid interpolation: non-concrete value string (type string): 495 + // ./large.cue:7:25 496 + // ./large.cue:3:12 497 + } 498 + } 499 + patches: (#list){ 500 + 0: (#struct){ 501 + op: (string){ "add" } 502 + path: (string){ "/metadata" } 503 + value: (_|_){ 504 + // [incomplete] full.#Resource.pickMsg.msg: invalid interpolation: non-concrete value string (type string): 505 + // ./large.cue:7:25 506 + // ./large.cue:3:12 507 + } 508 + } 509 + } 510 + } 511 + #Patches: (#struct){ 512 + } 513 + #JSONPatch: (#struct){ 514 + namespace?: (string){ string } 515 + patch: (list){ 516 + } 517 + output: (_|_){ 518 + // [incomplete] full.#JSONPatch.output: cannot reference optional field: namespace: 519 + // ./large.cue:21:24 520 + } 521 + } 522 + #JSONOp: (#struct){ |((#struct){ 523 + op: (string){ "add" } 524 + path: (string){ string } 525 + value: (_){ _ } 526 + }, (#struct){ 527 + op: (string){ "remove" } 528 + path: (string){ string } 529 + }) } 530 + #Main: (#struct){ 531 + namespace: (string){ string } 532 + output: (_|_){ 533 + // [incomplete] full.#Main.jsonPatch.output: key value of dynamic field must be concrete, found string: 534 + // ./large.cue:21:24 535 + // ./large.cue:19:15 536 + } 537 + let jsonPatch#2 = (#struct){ 538 + let base#5 = (#struct){ 539 + someMsg: (string){ string } 540 + obs: (#struct){ |(*(#struct){ 541 + missing: (bool){ true } 542 + }, (#struct){ 543 + }) } 544 + let pickMsg#1 = (#struct){ 545 + msg: (_|_){ 546 + // [incomplete] full.#Main.jsonPatch.base.pickMsg.msg: invalid interpolation: non-concrete value string (type string): 547 + // ./large.cue:7:25 548 + // ./large.cue:3:12 549 + } 550 + } 551 + patches: (#list){ 552 + 0: (#struct){ 553 + op: (string){ "add" } 554 + path: (string){ "/metadata" } 555 + value: (_|_){ 556 + // [incomplete] full.#Main.jsonPatch.base.pickMsg.msg: invalid interpolation: non-concrete value string (type string): 557 + // ./large.cue:7:25 558 + // ./large.cue:3:12 559 + } 560 + } 561 + } 562 + } 563 + let withMsg#6 = (#struct){ 564 + someMsg: (string){ "foo" } 565 + obs: (#struct){ |(*(#struct){ 566 + missing: (bool){ true } 567 + }, (#struct){ 568 + }) } 569 + let pickMsg#1 = (#struct){ 570 + msg: (_|_){ 571 + // [incomplete] full.#Main.jsonPatch.withMsg.pickMsg.msg: invalid interpolation: non-concrete value string (type string): 572 + // ./large.cue:7:25 573 + // ./large.cue:3:12 574 + } 575 + } 576 + patches: (#list){ 577 + 0: (#struct){ 578 + op: (string){ "add" } 579 + path: (string){ "/metadata" } 580 + value: (_|_){ 581 + // [incomplete] full.#Main.jsonPatch.withMsg.pickMsg.msg: invalid interpolation: non-concrete value string (type string): 582 + // ./large.cue:7:25 583 + // ./large.cue:3:12 584 + } 585 + } 586 + } 587 + } 588 + namespace: (string){ string } 589 + patch: (#list){ 590 + 0: (_|_){ 591 + // [incomplete] full.#Main.jsonPatch.patch.0: 2 errors in empty disjunction: 592 + // full.#Main.jsonPatch.patch.0.op: conflicting values "remove" and "add": 593 + // ./large.cue:11:11 594 + // ./large.cue:28:9 595 + // full.#Main.jsonPatch.patch.0.value: invalid interpolation: non-concrete value string (type string): 596 + // ./large.cue:7:25 597 + // ./large.cue:3:12 598 + op: (string){ "add" } 599 + path: (string){ "/metadata" } 600 + value: (_){ _ } 601 + } 602 + } 603 + output: (_|_){ 604 + // [incomplete] full.#Main.jsonPatch.output: key value of dynamic field must be concrete, found string: 605 + // ./large.cue:21:24 606 + // ./large.cue:19:15 607 + } 608 + } 609 + } 610 + out: (#struct){ 611 + ns1: (#list){ 612 + 0: (_|_){ 613 + // [incomplete] jsonPatch.output.ns1.0: 2 errors in empty disjunction: 614 + // jsonPatch.output.ns1.0.op: conflicting values "remove" and "add": 615 + // ./large.cue:11:11 616 + // ./large.cue:28:9 617 + // jsonPatch.output.ns1.0.value: invalid interpolation: non-concrete value string (type string): 618 + // ./large.cue:7:25 619 + // ./large.cue:3:12 620 + op: (string){ "add" } 621 + path: (string){ "/metadata" } 622 + value: (_){ _ } 623 + } 624 + } 625 + } 626 + } 627 + } 628 + -- diff/-out/evalalpha<==>+out/eval -- 629 + diff old new 630 + --- old 631 + +++ new 632 + @@ -1,75 +1,37 @@ 633 + Errors: 634 + -and.transitive.out.ok: field not allowed: 635 + - ./in.cue:34:5 636 + - ./in.cue:35:6 637 + - ./in.cue:36:6 638 + - ./in.cue:36:11 639 + - ./in.cue:37:7 640 + - ./in.cue:38:3 641 + -and.transitiveWithEmbed.out.ok: field not allowed: 642 + - ./in.cue:42:5 643 + - ./in.cue:43:6 644 + - ./in.cue:43:11 645 + - ./in.cue:44:6 646 + - ./in.cue:44:7 647 + - ./in.cue:45:7 648 + - ./in.cue:46:3 649 + -embed.andEmbed.d.err: field not allowed: 650 + - ./in.cue:28:6 651 + - ./in.cue:29:6 652 + - ./in.cue:30:6 653 + - ./in.cue:30:7 654 + - ./in.cue:30:12 655 + - ./in.cue:31:5 656 + - ./in.cue:31:11 657 + +embed.openValidator.t2.a.b: conflicting values 1 and {b?:Y} (mismatched types int and struct): 658 + + ./validators.cue:22:5 659 + + ./validators.cue:24:8 660 + +embed.simple.a.err: field not allowed: 661 + + ./in.cue:3:7 662 + + ./in.cue:4:5 663 + embed.andInStruct.a.err: field not allowed: 664 + - ./in.cue:7:8 665 + - ./in.cue:8:5 666 + ./in.cue:8:7 667 + ./in.cue:8:16 668 + -embed.embedAndRecursive.x.err: field not allowed: 669 + - ./in.cue:23:6 670 + - ./in.cue:24:8 671 + - ./in.cue:25:2 672 + - ./in.cue:25:11 673 + -embed.embedComprehension.a.err: field not allowed: 674 + - ./in.cue:15:8 675 + - ./in.cue:15:9 676 + - ./in.cue:15:17 677 + - ./in.cue:16:5 678 + - ./in.cue:16:7 679 + - ./in.cue:16:16 680 + embed.embedDefWithEmbedding.a.err: field not allowed: 681 + - ./in.cue:11:8 682 + - ./in.cue:11:9 683 + - ./in.cue:12:5 684 + ./in.cue:12:7 685 + ./in.cue:12:16 686 + +embed.embedComprehension.a.err: field not allowed: 687 + + ./in.cue:15:21 688 + + ./in.cue:16:16 689 + embed.fieldWithAnd.a.err: field not allowed: 690 + - ./in.cue:19:6 691 + - ./in.cue:20:2 692 + ./in.cue:20:7 693 + ./in.cue:20:13 694 + +embed.embedAndRecursive.x.err: field not allowed: 695 + + ./in.cue:24:8 696 + + ./in.cue:25:11 697 + +embed.andEmbed.d.err: field not allowed: 698 + + ./in.cue:30:12 699 + + ./in.cue:31:11 700 + +and.transitive.out.ok: field not allowed: 701 + + ./in.cue:35:6 702 + + ./in.cue:38:3 703 + +and.transitiveWithEmbed.out.ok: field not allowed: 704 + + ./in.cue:44:7 705 + + ./in.cue:46:3 706 + embed.normalValidator.x.err: field not allowed: 707 + - ./validators.cue:3:6 708 + - ./validators.cue:8:5 709 + + ./validators.cue:4:3 710 + ./validators.cue:9:5 711 + -embed.openValidator.t2.a.b: conflicting values 1 and {b?:Y} (mismatched types int and struct): 712 + - ./validators.cue:21:16 713 + - ./validators.cue:22:5 714 + - ./validators.cue:22:9 715 + - ./validators.cue:23:5 716 + - ./validators.cue:24:8 717 + -embed.simple.a.err: field not allowed: 718 + - ./in.cue:2:6 719 + - ./in.cue:3:5 720 + - ./in.cue:3:7 721 + - ./in.cue:4:5 722 + -embed.openValidator.t1.x.err: field not allowed: 723 + - ./validators.cue:13:3 724 + - ./validators.cue:12:6 725 + - ./validators.cue:17:5 726 + - ./validators.cue:18:5 727 + embed.openValidator.t2.a.b: invalid value 1 (does not satisfy matchN): 0 matched, expected 1: 728 + ./validators.cue:21:5 729 + ./validators.cue:21:12 730 + @@ -88,14 +50,12 @@ 731 + } 732 + a: (_|_){ 733 + // [eval] 734 + - b: (int){ 1 } 735 + err: (_|_){ 736 + // [eval] embed.simple.a.err: field not allowed: 737 + - // ./in.cue:2:6 738 + - // ./in.cue:3:5 739 + // ./in.cue:3:7 740 + // ./in.cue:4:5 741 + } 742 + + b: (int){ 1 } 743 + } 744 + } 745 + andInStruct: (_|_){ 746 + @@ -105,14 +65,12 @@ 747 + } 748 + a: (_|_){ 749 + // [eval] 750 + - a: (int){ int } 751 + err: (_|_){ 752 + // [eval] embed.andInStruct.a.err: field not allowed: 753 + - // ./in.cue:7:8 754 + - // ./in.cue:8:5 755 + // ./in.cue:8:7 756 + // ./in.cue:8:16 757 + } 758 + + a: (int){ int } 759 + } 760 + } 761 + embedDefWithEmbedding: (_|_){ 762 + @@ -122,15 +80,12 @@ 763 + } 764 + a: (_|_){ 765 + // [eval] 766 + - a: (int){ int } 767 + err: (_|_){ 768 + // [eval] embed.embedDefWithEmbedding.a.err: field not allowed: 769 + - // ./in.cue:11:8 770 + - // ./in.cue:11:9 771 + - // ./in.cue:12:5 772 + // ./in.cue:12:7 773 + // ./in.cue:12:16 774 + } 775 + + a: (int){ int } 776 + } 777 + } 778 + embedComprehension: (_|_){ 779 + @@ -140,16 +95,12 @@ 780 + } 781 + a: (_|_){ 782 + // [eval] 783 + - a: (int){ int } 784 + err: (_|_){ 785 + // [eval] embed.embedComprehension.a.err: field not allowed: 786 + - // ./in.cue:15:8 787 + - // ./in.cue:15:9 788 + - // ./in.cue:15:17 789 + - // ./in.cue:16:5 790 + - // ./in.cue:16:7 791 + + // ./in.cue:15:21 792 + // ./in.cue:16:16 793 + } 794 + + a: (int){ int } 795 + } 796 + } 797 + fieldWithAnd: (_|_){ 798 + @@ -160,8 +111,6 @@ 799 + // [eval] 800 + err: (_|_){ 801 + // [eval] embed.fieldWithAnd.a.err: field not allowed: 802 + - // ./in.cue:19:6 803 + - // ./in.cue:20:2 804 + // ./in.cue:20:7 805 + // ./in.cue:20:13 806 + } 807 + @@ -173,20 +122,16 @@ 808 + a: (int){ int } 809 + } 810 + B: (struct){ 811 + - x: (#struct){ 812 + - a: (int){ int } 813 + - } 814 + - } 815 + - x: (_|_){ 816 + - // [eval] 817 + - a: (int){ int } 818 + + x: ~(embed.embedAndRecursive.#A) 819 + + } 820 + + x: (_|_){ 821 + + // [eval] 822 + err: (_|_){ 823 + // [eval] embed.embedAndRecursive.x.err: field not allowed: 824 + - // ./in.cue:23:6 825 + // ./in.cue:24:8 826 + - // ./in.cue:25:2 827 + // ./in.cue:25:11 828 + } 829 + + a: (int){ int } 830 + } 831 + } 832 + andEmbed: (_|_){ 833 + @@ -202,17 +147,12 @@ 834 + } 835 + d: (_|_){ 836 + // [eval] 837 + - b: (int){ int } 838 + err: (_|_){ 839 + // [eval] embed.andEmbed.d.err: field not allowed: 840 + - // ./in.cue:28:6 841 + - // ./in.cue:29:6 842 + - // ./in.cue:30:6 843 + - // ./in.cue:30:7 844 + // ./in.cue:30:12 845 + - // ./in.cue:31:5 846 + // ./in.cue:31:11 847 + } 848 + + b: (int){ int } 849 + } 850 + } 851 + nonDef: (struct){ 852 + @@ -221,12 +161,12 @@ 853 + a: (string){ string } 854 + } 855 + #Y: (#struct){ 856 + - a: (string){ string } 857 + - b?: (string){ string } 858 + + b?: (string){ string } 859 + + a: (string){ string } 860 + } 861 + #Z: (#struct){ 862 + - a: (string){ string } 863 + - b?: (string){ string } 864 + + b?: (string){ string } 865 + + a: (string){ string } 866 + } 867 + } 868 + } 869 + @@ -236,12 +176,12 @@ 870 + Name: (string){ string } 871 + } 872 + #Step: (#struct){ 873 + - Name: (string){ string } 874 + - Path?: (string){ string } 875 + + Path?: (string){ string } 876 + + Name: (string){ string } 877 + } 878 + #Command: (#struct){ 879 + - Name: (string){ string } 880 + - Path?: (string){ string } 881 + + Path?: (string){ string } 882 + + Name: (string){ string } 883 + } 884 + out: (#struct){ 885 + Name: (string){ "foo" } 886 + @@ -256,21 +196,21 @@ 887 + b?: (int){ int } 888 + } 889 + x: (_|_){ 890 + - // [eval] 891 + - a?: (int){ int } 892 + - b?: (int){ int } 893 + + // [eval] embed.normalValidator.x.err: field not allowed: 894 + + // ./validators.cue:4:3 895 + + // ./validators.cue:9:5 896 + err: (_|_){ 897 + // [eval] embed.normalValidator.x.err: field not allowed: 898 + - // ./validators.cue:3:6 899 + - // ./validators.cue:8:5 900 + + // ./validators.cue:4:3 901 + // ./validators.cue:9:5 902 + } 903 + + a?: (int){ int } 904 + + b?: (int){ int } 905 + } 906 + } 907 + openValidator: (_|_){ 908 + // [eval] 909 + - t1: (_|_){ 910 + - // [eval] 911 + + t1: (struct){ 912 + #X: (_){ 913 + matchN(0, (#list){ 914 + }) 915 + @@ -277,17 +217,10 @@ 916 + a?: (int){ int } 917 + b?: (int){ int } 918 + } 919 + - x: (_|_){ 920 + - // [eval] 921 + - a?: (int){ int } 922 + - b?: (int){ int } 923 + - err: (_|_){ 924 + - // [eval] embed.openValidator.t1.x.err: field not allowed: 925 + - // ./validators.cue:13:3 926 + - // ./validators.cue:12:6 927 + - // ./validators.cue:17:5 928 + - // ./validators.cue:18:5 929 + - } 930 + + x: (#struct){ 931 + + err: (int){ 1 } 932 + + a?: (int){ int } 933 + + b?: (int){ int } 934 + } 935 + } 936 + t2: (_|_){ 937 + @@ -306,10 +239,7 @@ 938 + // [eval] 939 + b: (_|_){ 940 + // [eval] embed.openValidator.t2.a.b: conflicting values 1 and {b?:Y} (mismatched types int and struct): 941 + - // ./validators.cue:21:16 942 + // ./validators.cue:22:5 943 + - // ./validators.cue:22:9 944 + - // ./validators.cue:23:5 945 + // ./validators.cue:24:8 946 + // embed.openValidator.t2.a.b: invalid value 1 (does not satisfy matchN): 0 matched, expected 1: 947 + // ./validators.cue:21:5 948 + @@ -336,16 +266,12 @@ 949 + } 950 + out: (_|_){ 951 + // [eval] 952 + - a: (string){ string } 953 + ok: (_|_){ 954 + // [eval] and.transitive.out.ok: field not allowed: 955 + - // ./in.cue:34:5 956 + // ./in.cue:35:6 957 + - // ./in.cue:36:6 958 + - // ./in.cue:36:11 959 + - // ./in.cue:37:7 960 + // ./in.cue:38:3 961 + } 962 + + a: (string){ string } 963 + } 964 + } 965 + transitiveWithEmbed: (_|_){ 966 + @@ -361,17 +287,12 @@ 967 + } 968 + out: (_|_){ 969 + // [eval] 970 + - a: (string){ string } 971 + ok: (_|_){ 972 + // [eval] and.transitiveWithEmbed.out.ok: field not allowed: 973 + - // ./in.cue:42:5 974 + - // ./in.cue:43:6 975 + - // ./in.cue:43:11 976 + - // ./in.cue:44:6 977 + // ./in.cue:44:7 978 + - // ./in.cue:45:7 979 + // ./in.cue:46:3 980 + } 981 + + a: (string){ string } 982 + } 983 + } 984 + } 985 + @@ -394,7 +315,7 @@ 986 + op: (string){ "add" } 987 + path: (string){ "/metadata" } 988 + value: (_|_){ 989 + - // [incomplete] full.#Resource.patches.0.value: invalid interpolation: non-concrete value string (type string): 990 + + // [incomplete] full.#Resource.pickMsg.msg: invalid interpolation: non-concrete value string (type string): 991 + // ./large.cue:7:25 992 + // ./large.cue:3:12 993 + } 994 + @@ -423,38 +344,11 @@ 995 + #Main: (#struct){ 996 + namespace: (string){ string } 997 + output: (_|_){ 998 + - // [incomplete] full.#Main.output: invalid non-ground value string (must be concrete string): 999 + + // [incomplete] full.#Main.jsonPatch.output: key value of dynamic field must be concrete, found string: 1000 + + // ./large.cue:21:24 1001 + // ./large.cue:19:15 1002 + - // ./large.cue:41:15 1003 + - _: (#list){ 1004 + - 0: (#struct){ 1005 + - op: (string){ "add" } 1006 + - path: (string){ "/metadata" } 1007 + - value: (string){ "foo" } 1008 + - } 1009 + - } 1010 + } 1011 + let jsonPatch#2 = (#struct){ 1012 + - namespace: (string){ string } 1013 + - patch: (#list){ 1014 + - 0: (#struct){ 1015 + - op: (string){ "add" } 1016 + - path: (string){ "/metadata" } 1017 + - value: (string){ "foo" } 1018 + - } 1019 + - } 1020 + - output: (_|_){ 1021 + - // [incomplete] full.#Main.jsonPatch.output: invalid non-ground value string (must be concrete string): 1022 + - // ./large.cue:19:15 1023 + - // ./large.cue:41:15 1024 + - _: (#list){ 1025 + - 0: (#struct){ 1026 + - op: (string){ "add" } 1027 + - path: (string){ "/metadata" } 1028 + - value: (string){ "foo" } 1029 + - } 1030 + - } 1031 + - } 1032 + let base#5 = (#struct){ 1033 + someMsg: (string){ string } 1034 + obs: (#struct){ |(*(#struct){ 1035 + @@ -473,7 +367,7 @@ 1036 + op: (string){ "add" } 1037 + path: (string){ "/metadata" } 1038 + value: (_|_){ 1039 + - // [incomplete] full.#Main.jsonPatch.base.patches.0.value: invalid interpolation: non-concrete value string (type string): 1040 + + // [incomplete] full.#Main.jsonPatch.base.pickMsg.msg: invalid interpolation: non-concrete value string (type string): 1041 + // ./large.cue:7:25 1042 + // ./large.cue:3:12 1043 + } 1044 + @@ -487,24 +381,59 @@ 1045 + }, (#struct){ 1046 + }) } 1047 + let pickMsg#1 = (#struct){ 1048 + - msg: (string){ "foo" } 1049 + - } 1050 + - patches: (#list){ 1051 + - 0: (#struct){ 1052 + - op: (string){ "add" } 1053 + - path: (string){ "/metadata" } 1054 + - value: (string){ "foo" } 1055 + - } 1056 + - } 1057 + + msg: (_|_){ 1058 + + // [incomplete] full.#Main.jsonPatch.withMsg.pickMsg.msg: invalid interpolation: non-concrete value string (type string): 1059 + + // ./large.cue:7:25 1060 + + // ./large.cue:3:12 1061 + + } 1062 + + } 1063 + + patches: (#list){ 1064 + + 0: (#struct){ 1065 + + op: (string){ "add" } 1066 + + path: (string){ "/metadata" } 1067 + + value: (_|_){ 1068 + + // [incomplete] full.#Main.jsonPatch.withMsg.pickMsg.msg: invalid interpolation: non-concrete value string (type string): 1069 + + // ./large.cue:7:25 1070 + + // ./large.cue:3:12 1071 + + } 1072 + + } 1073 + + } 1074 + + } 1075 + + namespace: (string){ string } 1076 + + patch: (#list){ 1077 + + 0: (_|_){ 1078 + + // [incomplete] full.#Main.jsonPatch.patch.0: 2 errors in empty disjunction: 1079 + + // full.#Main.jsonPatch.patch.0.op: conflicting values "remove" and "add": 1080 + + // ./large.cue:11:11 1081 + + // ./large.cue:28:9 1082 + + // full.#Main.jsonPatch.patch.0.value: invalid interpolation: non-concrete value string (type string): 1083 + + // ./large.cue:7:25 1084 + + // ./large.cue:3:12 1085 + + op: (string){ "add" } 1086 + + path: (string){ "/metadata" } 1087 + + value: (_){ _ } 1088 + + } 1089 + + } 1090 + + output: (_|_){ 1091 + + // [incomplete] full.#Main.jsonPatch.output: key value of dynamic field must be concrete, found string: 1092 + + // ./large.cue:21:24 1093 + + // ./large.cue:19:15 1094 + } 1095 + } 1096 + } 1097 + out: (#struct){ 1098 + ns1: (#list){ 1099 + - 0: (#struct){ 1100 + - op: (string){ "add" } 1101 + - path: (string){ "/metadata" } 1102 + - value: (string){ "foo" } 1103 + + 0: (_|_){ 1104 + + // [incomplete] jsonPatch.output.ns1.0: 2 errors in empty disjunction: 1105 + + // jsonPatch.output.ns1.0.op: conflicting values "remove" and "add": 1106 + + // ./large.cue:11:11 1107 + + // ./large.cue:28:9 1108 + + // jsonPatch.output.ns1.0.value: invalid interpolation: non-concrete value string (type string): 1109 + + // ./large.cue:7:25 1110 + + // ./large.cue:3:12 1111 + + op: (string){ "add" } 1112 + + path: (string){ "/metadata" } 1113 + + value: (_){ _ } 1114 + } 1115 + } 1116 + } 1117 + -- diff/todo/p1 -- 1118 + embed.openValidator.err: unexpected pass. 1119 + and.full.out: failure in evalv3 1120 + -- diff/todo/p2 -- 1121 + and.transitive(WithEmbed)?.out.ok: unexpected error 1122 + -- out/eval -- 1123 + Errors: 1124 + and.transitive.out.ok: field not allowed: 1125 + ./in.cue:34:5 1126 + ./in.cue:35:6 1127 + ./in.cue:36:6 1128 + ./in.cue:36:11 1129 + ./in.cue:37:7 1130 + ./in.cue:38:3 1131 + and.transitiveWithEmbed.out.ok: field not allowed: 1132 + ./in.cue:42:5 1133 + ./in.cue:43:6 1134 + ./in.cue:43:11 1135 + ./in.cue:44:6 1136 + ./in.cue:44:7 1137 + ./in.cue:45:7 1138 + ./in.cue:46:3 1139 + embed.andEmbed.d.err: field not allowed: 1140 + ./in.cue:28:6 1141 + ./in.cue:29:6 1142 + ./in.cue:30:6 1143 + ./in.cue:30:7 1144 + ./in.cue:30:12 1145 + ./in.cue:31:5 1146 + ./in.cue:31:11 1147 + embed.andInStruct.a.err: field not allowed: 1148 + ./in.cue:7:8 1149 + ./in.cue:8:5 1150 + ./in.cue:8:7 1151 + ./in.cue:8:16 1152 + embed.embedAndRecursive.x.err: field not allowed: 1153 + ./in.cue:23:6 1154 + ./in.cue:24:8 1155 + ./in.cue:25:2 1156 + ./in.cue:25:11 1157 + embed.embedComprehension.a.err: field not allowed: 1158 + ./in.cue:15:8 1159 + ./in.cue:15:9 1160 + ./in.cue:15:17 1161 + ./in.cue:16:5 1162 + ./in.cue:16:7 1163 + ./in.cue:16:16 1164 + embed.embedDefWithEmbedding.a.err: field not allowed: 1165 + ./in.cue:11:8 1166 + ./in.cue:11:9 1167 + ./in.cue:12:5 1168 + ./in.cue:12:7 1169 + ./in.cue:12:16 1170 + embed.fieldWithAnd.a.err: field not allowed: 1171 + ./in.cue:19:6 1172 + ./in.cue:20:2 1173 + ./in.cue:20:7 1174 + ./in.cue:20:13 1175 + embed.normalValidator.x.err: field not allowed: 1176 + ./validators.cue:3:6 1177 + ./validators.cue:8:5 1178 + ./validators.cue:9:5 1179 + embed.openValidator.t2.a.b: conflicting values 1 and {b?:Y} (mismatched types int and struct): 1180 + ./validators.cue:21:16 1181 + ./validators.cue:22:5 1182 + ./validators.cue:22:9 1183 + ./validators.cue:23:5 1184 + ./validators.cue:24:8 1185 + embed.simple.a.err: field not allowed: 1186 + ./in.cue:2:6 1187 + ./in.cue:3:5 1188 + ./in.cue:3:7 1189 + ./in.cue:4:5 1190 + embed.openValidator.t1.x.err: field not allowed: 1191 + ./validators.cue:13:3 1192 + ./validators.cue:12:6 1193 + ./validators.cue:17:5 1194 + ./validators.cue:18:5 1195 + embed.openValidator.t2.a.b: invalid value 1 (does not satisfy matchN): 0 matched, expected 1: 1196 + ./validators.cue:21:5 1197 + ./validators.cue:21:12 1198 + ./validators.cue:22:9 1199 + ./validators.cue:24:8 1200 + 1201 + Result: 1202 + (_|_){ 1203 + // [eval] 1204 + embed: (_|_){ 1205 + // [eval] 1206 + simple: (_|_){ 1207 + // [eval] 1208 + #A: (#struct){ 1209 + b: (int){ 1 } 1210 + } 1211 + a: (_|_){ 1212 + // [eval] 1213 + b: (int){ 1 } 1214 + err: (_|_){ 1215 + // [eval] embed.simple.a.err: field not allowed: 1216 + // ./in.cue:2:6 1217 + // ./in.cue:3:5 1218 + // ./in.cue:3:7 1219 + // ./in.cue:4:5 1220 + } 1221 + } 1222 + } 1223 + andInStruct: (_|_){ 1224 + // [eval] 1225 + #Foo: (#struct){ 1226 + a: (int){ int } 1227 + } 1228 + a: (_|_){ 1229 + // [eval] 1230 + a: (int){ int } 1231 + err: (_|_){ 1232 + // [eval] embed.andInStruct.a.err: field not allowed: 1233 + // ./in.cue:7:8 1234 + // ./in.cue:8:5 1235 + // ./in.cue:8:7 1236 + // ./in.cue:8:16 1237 + } 1238 + } 1239 + } 1240 + embedDefWithEmbedding: (_|_){ 1241 + // [eval] 1242 + #Foo: (#struct){ 1243 + a: (int){ int } 1244 + } 1245 + a: (_|_){ 1246 + // [eval] 1247 + a: (int){ int } 1248 + err: (_|_){ 1249 + // [eval] embed.embedDefWithEmbedding.a.err: field not allowed: 1250 + // ./in.cue:11:8 1251 + // ./in.cue:11:9 1252 + // ./in.cue:12:5 1253 + // ./in.cue:12:7 1254 + // ./in.cue:12:16 1255 + } 1256 + } 1257 + } 1258 + embedComprehension: (_|_){ 1259 + // [eval] 1260 + #Foo: (#struct){ 1261 + a: (int){ int } 1262 + } 1263 + a: (_|_){ 1264 + // [eval] 1265 + a: (int){ int } 1266 + err: (_|_){ 1267 + // [eval] embed.embedComprehension.a.err: field not allowed: 1268 + // ./in.cue:15:8 1269 + // ./in.cue:15:9 1270 + // ./in.cue:15:17 1271 + // ./in.cue:16:5 1272 + // ./in.cue:16:7 1273 + // ./in.cue:16:16 1274 + } 1275 + } 1276 + } 1277 + fieldWithAnd: (_|_){ 1278 + // [eval] 1279 + #A: (#struct){ 1280 + } 1281 + a: (_|_){ 1282 + // [eval] 1283 + err: (_|_){ 1284 + // [eval] embed.fieldWithAnd.a.err: field not allowed: 1285 + // ./in.cue:19:6 1286 + // ./in.cue:20:2 1287 + // ./in.cue:20:7 1288 + // ./in.cue:20:13 1289 + } 1290 + } 1291 + } 1292 + embedAndRecursive: (_|_){ 1293 + // [eval] 1294 + #A: (#struct){ 1295 + a: (int){ int } 1296 + } 1297 + B: (struct){ 1298 + x: (#struct){ 1299 + a: (int){ int } 1300 + } 1301 + } 1302 + x: (_|_){ 1303 + // [eval] 1304 + a: (int){ int } 1305 + err: (_|_){ 1306 + // [eval] embed.embedAndRecursive.x.err: field not allowed: 1307 + // ./in.cue:23:6 1308 + // ./in.cue:24:8 1309 + // ./in.cue:25:2 1310 + // ./in.cue:25:11 1311 + } 1312 + } 1313 + } 1314 + andEmbed: (_|_){ 1315 + // [eval] 1316 + #A: (#struct){ 1317 + b: (int){ int } 1318 + } 1319 + #B: (#struct){ 1320 + b: (int){ int } 1321 + } 1322 + #D: (#struct){ 1323 + b: (int){ int } 1324 + } 1325 + d: (_|_){ 1326 + // [eval] 1327 + b: (int){ int } 1328 + err: (_|_){ 1329 + // [eval] embed.andEmbed.d.err: field not allowed: 1330 + // ./in.cue:28:6 1331 + // ./in.cue:29:6 1332 + // ./in.cue:30:6 1333 + // ./in.cue:30:7 1334 + // ./in.cue:30:12 1335 + // ./in.cue:31:5 1336 + // ./in.cue:31:11 1337 + } 1338 + } 1339 + } 1340 + nonDef: (struct){ 1341 + t1: (struct){ 1342 + X: (struct){ 1343 + a: (string){ string } 1344 + } 1345 + #Y: (#struct){ 1346 + a: (string){ string } 1347 + b?: (string){ string } 1348 + } 1349 + #Z: (#struct){ 1350 + a: (string){ string } 1351 + b?: (string){ string } 1352 + } 1353 + } 1354 + } 1355 + defAndHidden: (struct){ 1356 + full: (struct){ 1357 + _stepCommon: (struct){ 1358 + Name: (string){ string } 1359 + } 1360 + #Step: (#struct){ 1361 + Name: (string){ string } 1362 + Path?: (string){ string } 1363 + } 1364 + #Command: (#struct){ 1365 + Name: (string){ string } 1366 + Path?: (string){ string } 1367 + } 1368 + out: (#struct){ 1369 + Name: (string){ "foo" } 1370 + Path?: (string){ string } 1371 + } 1372 + } 1373 + } 1374 + normalValidator: (_|_){ 1375 + // [eval] 1376 + #X: (#struct){ 1377 + a?: (int){ int } 1378 + b?: (int){ int } 1379 + } 1380 + x: (_|_){ 1381 + // [eval] 1382 + a?: (int){ int } 1383 + b?: (int){ int } 1384 + err: (_|_){ 1385 + // [eval] embed.normalValidator.x.err: field not allowed: 1386 + // ./validators.cue:3:6 1387 + // ./validators.cue:8:5 1388 + // ./validators.cue:9:5 1389 + } 1390 + } 1391 + } 1392 + openValidator: (_|_){ 1393 + // [eval] 1394 + t1: (_|_){ 1395 + // [eval] 1396 + #X: (_){ 1397 + matchN(0, (#list){ 1398 + }) 1399 + a?: (int){ int } 1400 + b?: (int){ int } 1401 + } 1402 + x: (_|_){ 1403 + // [eval] 1404 + a?: (int){ int } 1405 + b?: (int){ int } 1406 + err: (_|_){ 1407 + // [eval] embed.openValidator.t1.x.err: field not allowed: 1408 + // ./validators.cue:13:3 1409 + // ./validators.cue:12:6 1410 + // ./validators.cue:17:5 1411 + // ./validators.cue:18:5 1412 + } 1413 + } 1414 + } 1415 + t2: (_|_){ 1416 + // [eval] 1417 + Y: (_){ matchN(1, (#list){ 1418 + 0: (_|_){// 〈1;X〉 1419 + } 1420 + }) } 1421 + X: (struct){ 1422 + b?: (_){ matchN(1, (#list){ 1423 + 0: (_|_){// 〈1;X〉 1424 + } 1425 + }) } 1426 + } 1427 + a: (_|_){ 1428 + // [eval] 1429 + b: (_|_){ 1430 + // [eval] embed.openValidator.t2.a.b: conflicting values 1 and {b?:Y} (mismatched types int and struct): 1431 + // ./validators.cue:21:16 1432 + // ./validators.cue:22:5 1433 + // ./validators.cue:22:9 1434 + // ./validators.cue:23:5 1435 + // ./validators.cue:24:8 1436 + // embed.openValidator.t2.a.b: invalid value 1 (does not satisfy matchN): 0 matched, expected 1: 1437 + // ./validators.cue:21:5 1438 + // ./validators.cue:21:12 1439 + // ./validators.cue:22:9 1440 + // ./validators.cue:24:8 1441 + } 1442 + } 1443 + } 1444 + } 1445 + } 1446 + and: (_|_){ 1447 + // [eval] 1448 + transitive: (_|_){ 1449 + // [eval] 1450 + Z: (struct){ 1451 + a: (string){ string } 1452 + } 1453 + #Y: (#struct){ 1454 + a: (string){ string } 1455 + } 1456 + #X: (#struct){ 1457 + a: (string){ string } 1458 + } 1459 + out: (_|_){ 1460 + // [eval] 1461 + a: (string){ string } 1462 + ok: (_|_){ 1463 + // [eval] and.transitive.out.ok: field not allowed: 1464 + // ./in.cue:34:5 1465 + // ./in.cue:35:6 1466 + // ./in.cue:36:6 1467 + // ./in.cue:36:11 1468 + // ./in.cue:37:7 1469 + // ./in.cue:38:3 1470 + } 1471 + } 1472 + } 1473 + transitiveWithEmbed: (_|_){ 1474 + // [eval] 1475 + Z: (struct){ 1476 + a: (string){ string } 1477 + } 1478 + #X: (#struct){ 1479 + a: (string){ string } 1480 + } 1481 + #Y: (#struct){ 1482 + a: (string){ string } 1483 + } 1484 + out: (_|_){ 1485 + // [eval] 1486 + a: (string){ string } 1487 + ok: (_|_){ 1488 + // [eval] and.transitiveWithEmbed.out.ok: field not allowed: 1489 + // ./in.cue:42:5 1490 + // ./in.cue:43:6 1491 + // ./in.cue:43:11 1492 + // ./in.cue:44:6 1493 + // ./in.cue:44:7 1494 + // ./in.cue:45:7 1495 + // ./in.cue:46:3 1496 + } 1497 + } 1498 + } 1499 + } 1500 + full: (struct){ 1501 + #Resource: (#struct){ 1502 + someMsg: (string){ string } 1503 + obs: (#struct){ |(*(#struct){ 1504 + missing: (bool){ true } 1505 + }, (#struct){ 1506 + }) } 1507 + let pickMsg#1 = (#struct){ 1508 + msg: (_|_){ 1509 + // [incomplete] full.#Resource.pickMsg.msg: invalid interpolation: non-concrete value string (type string): 1510 + // ./large.cue:7:25 1511 + // ./large.cue:3:12 1512 + } 1513 + } 1514 + patches: (#list){ 1515 + 0: (#struct){ 1516 + op: (string){ "add" } 1517 + path: (string){ "/metadata" } 1518 + value: (_|_){ 1519 + // [incomplete] full.#Resource.patches.0.value: invalid interpolation: non-concrete value string (type string): 1520 + // ./large.cue:7:25 1521 + // ./large.cue:3:12 1522 + } 1523 + } 1524 + } 1525 + } 1526 + #Patches: (#struct){ 1527 + } 1528 + #JSONPatch: (#struct){ 1529 + namespace?: (string){ string } 1530 + patch: (list){ 1531 + } 1532 + output: (_|_){ 1533 + // [incomplete] full.#JSONPatch.output: cannot reference optional field: namespace: 1534 + // ./large.cue:21:24 1535 + } 1536 + } 1537 + #JSONOp: (#struct){ |((#struct){ 1538 + op: (string){ "add" } 1539 + path: (string){ string } 1540 + value: (_){ _ } 1541 + }, (#struct){ 1542 + op: (string){ "remove" } 1543 + path: (string){ string } 1544 + }) } 1545 + #Main: (#struct){ 1546 + namespace: (string){ string } 1547 + output: (_|_){ 1548 + // [incomplete] full.#Main.output: invalid non-ground value string (must be concrete string): 1549 + // ./large.cue:19:15 1550 + // ./large.cue:41:15 1551 + _: (#list){ 1552 + 0: (#struct){ 1553 + op: (string){ "add" } 1554 + path: (string){ "/metadata" } 1555 + value: (string){ "foo" } 1556 + } 1557 + } 1558 + } 1559 + let jsonPatch#2 = (#struct){ 1560 + namespace: (string){ string } 1561 + patch: (#list){ 1562 + 0: (#struct){ 1563 + op: (string){ "add" } 1564 + path: (string){ "/metadata" } 1565 + value: (string){ "foo" } 1566 + } 1567 + } 1568 + output: (_|_){ 1569 + // [incomplete] full.#Main.jsonPatch.output: invalid non-ground value string (must be concrete string): 1570 + // ./large.cue:19:15 1571 + // ./large.cue:41:15 1572 + _: (#list){ 1573 + 0: (#struct){ 1574 + op: (string){ "add" } 1575 + path: (string){ "/metadata" } 1576 + value: (string){ "foo" } 1577 + } 1578 + } 1579 + } 1580 + let base#5 = (#struct){ 1581 + someMsg: (string){ string } 1582 + obs: (#struct){ |(*(#struct){ 1583 + missing: (bool){ true } 1584 + }, (#struct){ 1585 + }) } 1586 + let pickMsg#1 = (#struct){ 1587 + msg: (_|_){ 1588 + // [incomplete] full.#Main.jsonPatch.base.pickMsg.msg: invalid interpolation: non-concrete value string (type string): 1589 + // ./large.cue:7:25 1590 + // ./large.cue:3:12 1591 + } 1592 + } 1593 + patches: (#list){ 1594 + 0: (#struct){ 1595 + op: (string){ "add" } 1596 + path: (string){ "/metadata" } 1597 + value: (_|_){ 1598 + // [incomplete] full.#Main.jsonPatch.base.patches.0.value: invalid interpolation: non-concrete value string (type string): 1599 + // ./large.cue:7:25 1600 + // ./large.cue:3:12 1601 + } 1602 + } 1603 + } 1604 + } 1605 + let withMsg#6 = (#struct){ 1606 + someMsg: (string){ "foo" } 1607 + obs: (#struct){ |(*(#struct){ 1608 + missing: (bool){ true } 1609 + }, (#struct){ 1610 + }) } 1611 + let pickMsg#1 = (#struct){ 1612 + msg: (string){ "foo" } 1613 + } 1614 + patches: (#list){ 1615 + 0: (#struct){ 1616 + op: (string){ "add" } 1617 + path: (string){ "/metadata" } 1618 + value: (string){ "foo" } 1619 + } 1620 + } 1621 + } 1622 + } 1623 + } 1624 + out: (#struct){ 1625 + ns1: (#list){ 1626 + 0: (#struct){ 1627 + op: (string){ "add" } 1628 + path: (string){ "/metadata" } 1629 + value: (string){ "foo" } 1630 + } 1631 + } 1632 + } 1633 + } 1634 + } 1635 + -- out/compile -- 1636 + --- in.cue 1637 + { 1638 + embed: { 1639 + simple: { 1640 + #A: { 1641 + b: 1 1642 + } 1643 + a: { 1644 + 〈1;#A〉 1645 + } 1646 + a: { 1647 + err: 1 1648 + } 1649 + } 1650 + } 1651 + embed: { 1652 + andInStruct: { 1653 + #Foo: { 1654 + a: int 1655 + } 1656 + a: { 1657 + (〈1;#Foo〉 & { 1658 + err: 2 1659 + }) 1660 + } 1661 + } 1662 + } 1663 + embed: { 1664 + embedDefWithEmbedding: { 1665 + #Foo: { 1666 + { 1667 + a: int 1668 + } 1669 + } 1670 + a: { 1671 + (〈1;#Foo〉 & { 1672 + err: 2 1673 + }) 1674 + } 1675 + } 1676 + } 1677 + embed: { 1678 + embedComprehension: { 1679 + #Foo: { 1680 + if true { 1681 + a: int 1682 + } 1683 + } 1684 + a: { 1685 + (〈1;#Foo〉 & { 1686 + err: 2 1687 + }) 1688 + } 1689 + } 1690 + } 1691 + embed: { 1692 + fieldWithAnd: { 1693 + #A: {} 1694 + { 1695 + a: (〈1;#A〉 & { 1696 + err: 3 1697 + }) 1698 + } 1699 + } 1700 + } 1701 + embed: { 1702 + embedAndRecursive: { 1703 + #A: { 1704 + a: int 1705 + } 1706 + B: { 1707 + x: 〈1;#A〉 1708 + } 1709 + (〈0;B〉 & { 1710 + x: { 1711 + err: 2 1712 + } 1713 + }) 1714 + } 1715 + } 1716 + embed: { 1717 + andEmbed: { 1718 + #A: { 1719 + b: int 1720 + } 1721 + #B: { 1722 + b: int 1723 + } 1724 + #D: { 1725 + (〈1;#A〉 & 〈1;#B〉) 1726 + } 1727 + d: (〈0;#D〉 & { 1728 + err: 3 1729 + }) 1730 + } 1731 + } 1732 + and: { 1733 + transitive: { 1734 + Z: { 1735 + a: string 1736 + } 1737 + #Y: 〈0;Z〉 1738 + #X: (〈0;#Y〉 & 〈0;Z〉) 1739 + out: (〈0;#X〉 & { 1740 + ok: "foo" 1741 + }) 1742 + } 1743 + } 1744 + and: { 1745 + transitiveWithEmbed: { 1746 + Z: { 1747 + a: string 1748 + } 1749 + #X: (〈0;#Y〉 & 〈0;Z〉) 1750 + #Y: { 1751 + 〈1;Z〉 1752 + } 1753 + out: (〈0;#X〉 & { 1754 + ok: "foo" 1755 + }) 1756 + } 1757 + } 1758 + embed: { 1759 + nonDef: { 1760 + t1: { 1761 + X: { 1762 + a: string 1763 + } 1764 + #Y: (〈0;#Z〉 & 〈0;X〉) 1765 + #Z: { 1766 + 〈1;X〉 1767 + b?: string 1768 + } 1769 + } 1770 + } 1771 + } 1772 + embed: { 1773 + defAndHidden: { 1774 + full: { 1775 + _stepCommon: { 1776 + Name: string 1777 + } 1778 + #Step: (〈0;#Command〉 & 〈0;_stepCommon〉) 1779 + #Command: { 1780 + 〈1;_stepCommon〉 1781 + Path?: string 1782 + } 1783 + out: (〈0;#Step〉 & { 1784 + Name: "foo" 1785 + }) 1786 + } 1787 + } 1788 + } 1789 + } 1790 + --- large.cue 1791 + { 1792 + full: { 1793 + #Resource: { 1794 + someMsg: string 1795 + obs: ({}|*{ 1796 + missing: true 1797 + }) 1798 + let pickMsg#1 = [ 1799 + if 〈1;obs〉.missing { 1800 + msg: "\(〈2;someMsg〉)" 1801 + }, 1802 + { 1803 + msg: "bar" 1804 + }, 1805 + ][0] 1806 + patches: [ 1807 + { 1808 + op: "add" 1809 + path: "/metadata" 1810 + value: 〈2;let pickMsg#1〉.msg 1811 + }, 1812 + ] 1813 + } 1814 + #Patches: { 1815 + [string]: _ 1816 + } 1817 + #JSONPatch: { 1818 + namespace?: string 1819 + patch: [ 1820 + ...〈2;#JSONOp〉, 1821 + ] 1822 + output: (〈1;#Patches〉 & { 1823 + 〈1;namespace〉: 〈1;patch〉 1824 + }) 1825 + } 1826 + #JSONOp: ({ 1827 + op: "add" 1828 + path: string 1829 + value: _ 1830 + }|{ 1831 + op: "remove" 1832 + path: string 1833 + }) 1834 + #Main: { 1835 + namespace: string 1836 + output: 〈0;let jsonPatch#2〉.output 1837 + let jsonPatch#2 = (〈1;#JSONPatch〉 & { 1838 + let base#5 = (〈2;#Resource〉 & {}) 1839 + let withMsg#6 = (〈0;let base#5〉 & { 1840 + someMsg: "foo" 1841 + }) 1842 + namespace: 〈1;namespace〉 1843 + patch: 〈0;let withMsg#6〉.patches 1844 + }) 1845 + } 1846 + out: (〈0;#Main〉 & { 1847 + namespace: "ns1" 1848 + }).output 1849 + } 1850 + } 1851 + --- validators.cue 1852 + { 1853 + embed: { 1854 + normalValidator: { 1855 + #X: { 1856 + 〈import;struct〉.MaxFields(1) 1857 + a?: int 1858 + b?: int 1859 + } 1860 + x: 〈0;#X〉 1861 + x: { 1862 + err: 1 1863 + } 1864 + } 1865 + } 1866 + embed: { 1867 + openValidator: { 1868 + t1: { 1869 + #X: { 1870 + matchN(0, []) 1871 + a?: int 1872 + b?: int 1873 + } 1874 + x: 〈0;#X〉 1875 + x: { 1876 + err: 1 1877 + } 1878 + } 1879 + } 1880 + } 1881 + embed: { 1882 + openValidator: { 1883 + t2: { 1884 + Y: matchN(1, [ 1885 + 〈1;X〉, 1886 + ]) 1887 + X: { 1888 + b?: 〈1;Y〉 1889 + } 1890 + a: 〈0;X〉 1891 + a: { 1892 + b: 1 1893 + } 1894 + } 1895 + } 1896 + } 1897 + }