cuelang.org/go@v0.13.0/cue/testdata/cycle/issue502.txtar (about) 1 -- in.cue -- 2 #T: { 3 config: _ 4 body: _ 5 mas: [string]: { 6 cfg: _ 7 _link: #T 8 link: _link & {config: cfg} 9 } 10 } 11 12 #a: #T & { 13 config: a: int 14 body: config.a 15 mas: one: { 16 cfg: b: config.a 17 _link: { 18 config: b: int 19 body: config.b 20 mas: two: { 21 cfg: c: config.b 22 _link: { 23 config: c: int 24 body: config.c 25 } 26 } 27 } 28 } 29 } 30 31 a: #a & {config: a: 34} 32 -- reduced.cue -- 33 reduced: t1: { 34 #T: x: y?: { 35 V: _ 36 z: #T & V & {} 37 } 38 a: #T 39 a: x: y: V: x: y: V: {} 40 } 41 -- out/evalalpha/stats -- 42 Leaks: 212 43 Freed: 0 44 Reused: 0 45 Allocs: 212 46 Retain: 0 47 48 Unifications: 211 49 Conjuncts: 441 50 Disjuncts: 0 51 52 CloseIDElems: 1003 53 NumCloseIDs: 85 54 -- diff/-out/evalalpha/stats<==>+out/eval/stats -- 55 diff old new 56 --- old 57 +++ new 58 @@ -1,9 +1,12 @@ 59 -Leaks: 0 60 -Freed: 120 61 -Reused: 107 62 -Allocs: 13 63 +Leaks: 212 64 +Freed: 0 65 +Reused: 0 66 +Allocs: 212 67 Retain: 0 68 69 -Unifications: 120 70 -Conjuncts: 320 71 -Disjuncts: 120 72 +Unifications: 211 73 +Conjuncts: 441 74 +Disjuncts: 0 75 + 76 +CloseIDElems: 1003 77 +NumCloseIDs: 85 78 -- out/eval/stats -- 79 Leaks: 0 80 Freed: 120 81 Reused: 107 82 Allocs: 13 83 Retain: 0 84 85 Unifications: 120 86 Conjuncts: 320 87 Disjuncts: 120 88 -- out/evalalpha -- 89 (struct){ 90 #T: (#struct){ 91 config: (_){ _ } 92 body: (_){ _ } 93 mas: (#struct){ 94 } 95 } 96 #a: (#struct){ 97 config: (#struct){ 98 a: (int){ int } 99 } 100 body: (int){ int } 101 mas: (#struct){ 102 one: (#struct){ 103 cfg: (#struct){ 104 b: (int){ int } 105 } 106 _link: (#struct){ 107 config: (#struct){ 108 b: (int){ int } 109 } 110 body: (int){ int } 111 mas: (#struct){ 112 two: (#struct){ 113 cfg: (#struct){ 114 c: (int){ int } 115 } 116 _link: (#struct){ 117 config: (#struct){ 118 c: (int){ int } 119 } 120 body: (int){ int } 121 mas: (#struct){ 122 } 123 } 124 link: (#struct){ 125 config: (#struct){ 126 c: (int){ int } 127 } 128 body: (int){ int } 129 mas: (#struct){ 130 } 131 } 132 } 133 } 134 } 135 link: (#struct){ 136 config: (#struct){ 137 b: (int){ int } 138 } 139 body: (int){ int } 140 mas: (#struct){ 141 two: (#struct){ 142 cfg: (#struct){ 143 c: (int){ int } 144 } 145 _link: (#struct){ 146 config: (#struct){ 147 c: (int){ int } 148 } 149 body: (int){ int } 150 mas: (#struct){ 151 } 152 } 153 link: (#struct){ 154 config: (#struct){ 155 c: (int){ int } 156 } 157 body: (int){ int } 158 mas: (#struct){ 159 } 160 } 161 } 162 } 163 } 164 } 165 } 166 } 167 a: (#struct){ 168 config: (#struct){ 169 a: (int){ 34 } 170 } 171 body: (int){ 34 } 172 mas: (#struct){ 173 one: (#struct){ 174 cfg: (#struct){ 175 b: (int){ 34 } 176 } 177 _link: (#struct){ 178 config: (#struct){ 179 b: (int){ int } 180 } 181 body: (int){ int } 182 mas: (#struct){ 183 two: (#struct){ 184 cfg: (#struct){ 185 c: (int){ int } 186 } 187 _link: (#struct){ 188 config: (#struct){ 189 c: (int){ int } 190 } 191 body: (int){ int } 192 mas: (#struct){ 193 } 194 } 195 link: (#struct){ 196 config: (#struct){ 197 c: (int){ int } 198 } 199 body: (int){ int } 200 mas: (#struct){ 201 } 202 } 203 } 204 } 205 } 206 link: (#struct){ 207 config: (#struct){ 208 b: (int){ 34 } 209 } 210 body: (int){ 34 } 211 mas: (#struct){ 212 two: (#struct){ 213 cfg: (#struct){ 214 c: (int){ 34 } 215 } 216 _link: (#struct){ 217 config: (#struct){ 218 c: (int){ int } 219 } 220 body: (int){ int } 221 mas: (#struct){ 222 } 223 } 224 link: (#struct){ 225 config: (#struct){ 226 c: (int){ 34 } 227 } 228 body: (int){ 34 } 229 mas: (#struct){ 230 } 231 } 232 } 233 } 234 } 235 } 236 } 237 } 238 reduced: (struct){ 239 t1: (struct){ 240 #T: (#struct){ 241 x: (#struct){ 242 y?: (#struct){ 243 V: (_){ _ } 244 z: (#struct){ 245 x: (#struct){ 246 y?: (_|_){ 247 // [structural cycle] 248 V: (_){ _ } 249 z: (_|_){ 250 // [structural cycle] reduced.t1.#T.x.y.z.x.y.z: structural cycle 251 } 252 } 253 } 254 } 255 } 256 } 257 } 258 a: (#struct){ 259 x: (#struct){ 260 y: (#struct){ 261 V: (#struct){ 262 x: (struct){ 263 y: (struct){ 264 V: (struct){ 265 } 266 } 267 } 268 } 269 z: (#struct){ 270 x: (#struct){ 271 y: (#struct){ 272 V: (#struct){ 273 } 274 z: (#struct){ 275 x: (#struct){ 276 y?: (_|_){ 277 // [structural cycle] 278 V: (_){ _ } 279 z: (_|_){ 280 // [structural cycle] reduced.t1.a.x.y.z.x.y.z.x.y.z: structural cycle 281 } 282 } 283 } 284 } 285 } 286 } 287 } 288 } 289 } 290 } 291 } 292 } 293 } 294 -- diff/-out/evalalpha<==>+out/eval -- 295 diff old new 296 --- old 297 +++ new 298 @@ -170,7 +170,7 @@ 299 a: (#struct){ 300 x: (#struct){ 301 y: (#struct){ 302 - V: (struct){ 303 + V: (#struct){ 304 x: (struct){ 305 y: (struct){ 306 V: (struct){ 307 -- out/eval -- 308 (struct){ 309 #T: (#struct){ 310 config: (_){ _ } 311 body: (_){ _ } 312 mas: (#struct){ 313 } 314 } 315 #a: (#struct){ 316 config: (#struct){ 317 a: (int){ int } 318 } 319 body: (int){ int } 320 mas: (#struct){ 321 one: (#struct){ 322 cfg: (#struct){ 323 b: (int){ int } 324 } 325 _link: (#struct){ 326 config: (#struct){ 327 b: (int){ int } 328 } 329 body: (int){ int } 330 mas: (#struct){ 331 two: (#struct){ 332 cfg: (#struct){ 333 c: (int){ int } 334 } 335 _link: (#struct){ 336 config: (#struct){ 337 c: (int){ int } 338 } 339 body: (int){ int } 340 mas: (#struct){ 341 } 342 } 343 link: (#struct){ 344 config: (#struct){ 345 c: (int){ int } 346 } 347 body: (int){ int } 348 mas: (#struct){ 349 } 350 } 351 } 352 } 353 } 354 link: (#struct){ 355 config: (#struct){ 356 b: (int){ int } 357 } 358 body: (int){ int } 359 mas: (#struct){ 360 two: (#struct){ 361 cfg: (#struct){ 362 c: (int){ int } 363 } 364 _link: (#struct){ 365 config: (#struct){ 366 c: (int){ int } 367 } 368 body: (int){ int } 369 mas: (#struct){ 370 } 371 } 372 link: (#struct){ 373 config: (#struct){ 374 c: (int){ int } 375 } 376 body: (int){ int } 377 mas: (#struct){ 378 } 379 } 380 } 381 } 382 } 383 } 384 } 385 } 386 a: (#struct){ 387 config: (#struct){ 388 a: (int){ 34 } 389 } 390 body: (int){ 34 } 391 mas: (#struct){ 392 one: (#struct){ 393 cfg: (#struct){ 394 b: (int){ 34 } 395 } 396 _link: (#struct){ 397 config: (#struct){ 398 b: (int){ int } 399 } 400 body: (int){ int } 401 mas: (#struct){ 402 two: (#struct){ 403 cfg: (#struct){ 404 c: (int){ int } 405 } 406 _link: (#struct){ 407 config: (#struct){ 408 c: (int){ int } 409 } 410 body: (int){ int } 411 mas: (#struct){ 412 } 413 } 414 link: (#struct){ 415 config: (#struct){ 416 c: (int){ int } 417 } 418 body: (int){ int } 419 mas: (#struct){ 420 } 421 } 422 } 423 } 424 } 425 link: (#struct){ 426 config: (#struct){ 427 b: (int){ 34 } 428 } 429 body: (int){ 34 } 430 mas: (#struct){ 431 two: (#struct){ 432 cfg: (#struct){ 433 c: (int){ 34 } 434 } 435 _link: (#struct){ 436 config: (#struct){ 437 c: (int){ int } 438 } 439 body: (int){ int } 440 mas: (#struct){ 441 } 442 } 443 link: (#struct){ 444 config: (#struct){ 445 c: (int){ 34 } 446 } 447 body: (int){ 34 } 448 mas: (#struct){ 449 } 450 } 451 } 452 } 453 } 454 } 455 } 456 } 457 reduced: (struct){ 458 t1: (struct){ 459 #T: (#struct){ 460 x: (#struct){ 461 y?: (#struct){ 462 V: (_){ _ } 463 z: (#struct){ 464 x: (#struct){ 465 y?: (_|_){ 466 // [structural cycle] 467 V: (_){ _ } 468 z: (_|_){ 469 // [structural cycle] reduced.t1.#T.x.y.z.x.y.z: structural cycle 470 } 471 } 472 } 473 } 474 } 475 } 476 } 477 a: (#struct){ 478 x: (#struct){ 479 y: (#struct){ 480 V: (struct){ 481 x: (struct){ 482 y: (struct){ 483 V: (struct){ 484 } 485 } 486 } 487 } 488 z: (#struct){ 489 x: (#struct){ 490 y: (#struct){ 491 V: (#struct){ 492 } 493 z: (#struct){ 494 x: (#struct){ 495 y?: (_|_){ 496 // [structural cycle] 497 V: (_){ _ } 498 z: (_|_){ 499 // [structural cycle] reduced.t1.a.x.y.z.x.y.z.x.y.z: structural cycle 500 } 501 } 502 } 503 } 504 } 505 } 506 } 507 } 508 } 509 } 510 } 511 } 512 } 513 -- out/compile -- 514 --- in.cue 515 { 516 #T: { 517 config: _ 518 body: _ 519 mas: { 520 [string]: { 521 cfg: _ 522 _link: 〈3;#T〉 523 link: (〈0;_link〉 & { 524 config: 〈1;cfg〉 525 }) 526 } 527 } 528 } 529 #a: (〈0;#T〉 & { 530 config: { 531 a: int 532 } 533 body: 〈0;config〉.a 534 mas: { 535 one: { 536 cfg: { 537 b: 〈3;config〉.a 538 } 539 _link: { 540 config: { 541 b: int 542 } 543 body: 〈0;config〉.b 544 mas: { 545 two: { 546 cfg: { 547 c: 〈3;config〉.b 548 } 549 _link: { 550 config: { 551 c: int 552 } 553 body: 〈0;config〉.c 554 } 555 } 556 } 557 } 558 } 559 } 560 }) 561 a: (〈0;#a〉 & { 562 config: { 563 a: 34 564 } 565 }) 566 } 567 --- reduced.cue 568 { 569 reduced: { 570 t1: { 571 #T: { 572 x: { 573 y?: { 574 V: _ 575 z: ((〈3;#T〉 & 〈0;V〉) & {}) 576 } 577 } 578 } 579 a: 〈0;#T〉 580 a: { 581 x: { 582 y: { 583 V: { 584 x: { 585 y: { 586 V: {} 587 } 588 } 589 } 590 } 591 } 592 } 593 } 594 } 595 }