cuelang.org/go@v0.13.0/cue/testdata/cycle/constraints.txtar (about)

     1  -- in.cue --
     2  // Not a cycle: the structure in x (c) only triggers one further
     3  // instantiation of y, but not enough to trigger another round.
     4  safeCycle: simple2: {
     5  	y: [string]: b: c: y
     6  	x: y
     7  	x: c: y
     8  }
     9  
    10  // Not a cycle: the structure in x (c) only triggers one further
    11  // instantiation of y, but not enough to trigger another round.
    12  safeCycle: long1: {
    13  	y: [string]: b: y
    14  	x: y
    15  	x: c: b: e: b: c: _
    16  }
    17  
    18  // Not a cycle: the structure in x (c) only triggers one further
    19  // instantiation of y, but not enough to trigger another round.
    20  safeCycle: long2: {
    21  	a: [string]: b: a
    22  	x: a
    23  	x: c: b: c: b: c: {}
    24  }
    25  
    26  // noCyclePattern is similar to the above cases, but involving more patterns
    27  // and various lengths.
    28  noCyclePattern: _
    29  
    30  noCyclePattern: t1: {
    31  	#D: [string]: #D
    32  	a: {}
    33  	[string]: #D
    34  	[string]: b: c: {}
    35  }
    36  
    37  noCyclePattern: t2: {
    38  	#D: [string]: x: #D
    39  	a: {}
    40  	[string]: #D
    41  	[string]: b: x: c: {}
    42  }
    43  
    44  noCyclePattern: t3: {
    45  	_D: [string]: _T
    46  	_T: x: _D
    47  	[string]: _D
    48  	[string]: b: x: c: {}
    49  	a: {}
    50  }
    51  
    52  noCyclePattern: t4: {
    53  	_D: [string]: x: _T
    54  	_T: y: _D
    55  	[string]: _D
    56  	[string]: b: x: {}
    57  	a: {}
    58  }
    59  
    60  noCyclePattern: t5: {
    61  	_D: [string]: x: _T
    62  	_T: y: _D
    63  	[string]: _D
    64  	[string]: b: x: y: c: x: {}
    65  	a: {}
    66  }
    67  
    68  // This example also has an embedding, in which case it should still behave
    69  // the same.
    70  noCyclePattern: t6: {
    71  	#D: [string]: #E
    72  
    73  	#E: t: #T
    74  
    75  	#T: {
    76  		{ object: #S }
    77  	}
    78  
    79  	#S: y: #D
    80  	[string]: x: #D
    81  	[string]: x: r: t: object: y: foo: t: object: {
    82  	}
    83  	bar: {}
    84  }
    85  
    86  // Cycle: x cyclic. The pattern constraint should not be seen as
    87  // "adding new structure", thereby permitting the cycle.
    88  noCancelSelfInvoke: t1: {
    89  	y: [string]: b: y
    90  	x: y
    91  	x: c: x
    92  }
    93  
    94  
    95  // Even though these cycles cross pattern boundaries, they are still structural
    96  // cycles as the reference includes a field that triggers the pattern.
    97  selfTriggerCycle: _
    98  
    99  // TODO: This does not show an explicit cycle within `a`, only a "child" cycle.
   100  // However, upon investigation this error is present in the tree. Either way,
   101  // the error only needs to be reported once, so this is not a huge problem.
   102  selfTriggerCycle: t1: {
   103  	a: #T
   104  	#T: {
   105  		[string]: #T
   106  		b: {}
   107  	}
   108  }
   109  
   110  selfTriggerCycle: t2: {
   111  	#T: [string]: X={
   112  		a: X
   113  	}
   114  	b: #T
   115  	b: c: {}
   116  }
   117  
   118  selfTriggerCycle: long1: {
   119  	// The long string of nested fields will initially exempt the structural
   120  	// cycle, but they will eventually run out, causing the cycle to be
   121  	// triggered.
   122  	a: [string]: b: a     // -> record conjunct from pattern per field.
   123  	a: c: b: c: b: c: {}  // -> track if any of the fields is not a cycle.
   124  }
   125  
   126  // TODO: see comment at selfTriggerCycle.t1
   127  selfTriggerCycle: issue1503: {
   128  	a: #T & {
   129  		a: one: link: a: two: {}
   130  	}
   131  	#T: {
   132  		a: [string]: link: #T
   133  		a: b: {}
   134  	}
   135  }
   136  
   137  mutuallyTriggeringCycle: t1: {
   138  	// Even though y itself, as well as each of the x fields are not cyclic,
   139  	// the combination of the two x conjuncts are, as the b fields of y will
   140  	// trigger the pattern constraints in an interleaved fashion.
   141  	y: [string]: b: y
   142  	x: y
   143  	x: c: y
   144  }
   145  -- ring.cue --
   146  brokenRing: t1: {
   147  	// NOTE that two permutations here have different results. That is less
   148  	// of an issue than it seems, as the structural cycle is hidden behind
   149  	// an optional path, which we generally allow.
   150  	// TODO: it would be nicer, though, if the representation were consistent.
   151  	p1: {
   152  		D: a?: T
   153  		T: b: D
   154  	}
   155  	p2: {
   156  		T: b: D
   157  		D: a?: T
   158  	}
   159  }
   160  
   161  brokenRing: t2: p1: {
   162  	D: [string]: T
   163  	T: b: D
   164  }
   165  
   166  brokenRing: t2: p2: {
   167  	T: b: D
   168  	D: [string]: T
   169  }
   170  
   171  cyclicRing: t1: {
   172  	D: a: T
   173  	T: b: D
   174  }
   175  -- issue3476.cue --
   176  issue3476: {
   177  	#a:  (#b & {x: _}).x
   178  	#b: {
   179  		x?: #c
   180  		#c: [string]: #c
   181  	}
   182  }
   183  -- issue3509.cue --
   184  issue3509: {
   185  	out: #job.step & "foo"
   186  
   187  	#job: (#Workflow & {job: _}).job
   188  
   189  	#Workflow: {
   190  		job: step: string
   191  
   192  		#matrixConfig: [...#matrixConfig] | string
   193  		matrix?: [string]: [...#matrixConfig]
   194  	}
   195  }
   196  -- out/compile --
   197  --- in.cue
   198  {
   199    safeCycle: {
   200      simple2: {
   201        y: {
   202          [string]: {
   203            b: {
   204              c: 〈3;y〉
   205            }
   206          }
   207        }
   208        x: 〈0;y〉
   209        x: {
   210          c: 〈1;y〉
   211        }
   212      }
   213    }
   214    safeCycle: {
   215      long1: {
   216        y: {
   217          [string]: {
   218            b: 〈2;y〉
   219          }
   220        }
   221        x: 〈0;y〉
   222        x: {
   223          c: {
   224            b: {
   225              e: {
   226                b: {
   227                  c: _
   228                }
   229              }
   230            }
   231          }
   232        }
   233      }
   234    }
   235    safeCycle: {
   236      long2: {
   237        a: {
   238          [string]: {
   239            b: 〈2;a〉
   240          }
   241        }
   242        x: 〈0;a〉
   243        x: {
   244          c: {
   245            b: {
   246              c: {
   247                b: {
   248                  c: {}
   249                }
   250              }
   251            }
   252          }
   253        }
   254      }
   255    }
   256    noCyclePattern: _
   257    noCyclePattern: {
   258      t1: {
   259        #D: {
   260          [string]: 〈1;#D〉
   261        }
   262        a: {}
   263        [string]: 〈0;#D〉
   264        [string]: {
   265          b: {
   266            c: {}
   267          }
   268        }
   269      }
   270    }
   271    noCyclePattern: {
   272      t2: {
   273        #D: {
   274          [string]: {
   275            x: 〈2;#D〉
   276          }
   277        }
   278        a: {}
   279        [string]: 〈0;#D〉
   280        [string]: {
   281          b: {
   282            x: {
   283              c: {}
   284            }
   285          }
   286        }
   287      }
   288    }
   289    noCyclePattern: {
   290      t3: {
   291        _D: {
   292          [string]: 〈1;_T〉
   293        }
   294        _T: {
   295          x: 〈1;_D〉
   296        }
   297        [string]: 〈0;_D〉
   298        [string]: {
   299          b: {
   300            x: {
   301              c: {}
   302            }
   303          }
   304        }
   305        a: {}
   306      }
   307    }
   308    noCyclePattern: {
   309      t4: {
   310        _D: {
   311          [string]: {
   312            x: 〈2;_T〉
   313          }
   314        }
   315        _T: {
   316          y: 〈1;_D〉
   317        }
   318        [string]: 〈0;_D〉
   319        [string]: {
   320          b: {
   321            x: {}
   322          }
   323        }
   324        a: {}
   325      }
   326    }
   327    noCyclePattern: {
   328      t5: {
   329        _D: {
   330          [string]: {
   331            x: 〈2;_T〉
   332          }
   333        }
   334        _T: {
   335          y: 〈1;_D〉
   336        }
   337        [string]: 〈0;_D〉
   338        [string]: {
   339          b: {
   340            x: {
   341              y: {
   342                c: {
   343                  x: {}
   344                }
   345              }
   346            }
   347          }
   348        }
   349        a: {}
   350      }
   351    }
   352    noCyclePattern: {
   353      t6: {
   354        #D: {
   355          [string]: 〈1;#E〉
   356        }
   357        #E: {
   358          t: 〈1;#T〉
   359        }
   360        #T: {
   361          {
   362            object: 〈2;#S〉
   363          }
   364        }
   365        #S: {
   366          y: 〈1;#D〉
   367        }
   368        [string]: {
   369          x: 〈1;#D〉
   370        }
   371        [string]: {
   372          x: {
   373            r: {
   374              t: {
   375                object: {
   376                  y: {
   377                    foo: {
   378                      t: {
   379                        object: {}
   380                      }
   381                    }
   382                  }
   383                }
   384              }
   385            }
   386          }
   387        }
   388        bar: {}
   389      }
   390    }
   391    noCancelSelfInvoke: {
   392      t1: {
   393        y: {
   394          [string]: {
   395            b: 〈2;y〉
   396          }
   397        }
   398        x: 〈0;y〉
   399        x: {
   400          c: 〈1;x〉
   401        }
   402      }
   403    }
   404    selfTriggerCycle: _
   405    selfTriggerCycle: {
   406      t1: {
   407        a: 〈0;#T〉
   408        #T: {
   409          [string]: 〈1;#T〉
   410          b: {}
   411        }
   412      }
   413    }
   414    selfTriggerCycle: {
   415      t2: {
   416        #T: {
   417          [string]: {
   418            a: 〈1〉
   419          }
   420        }
   421        b: 〈0;#T〉
   422        b: {
   423          c: {}
   424        }
   425      }
   426    }
   427    selfTriggerCycle: {
   428      long1: {
   429        a: {
   430          [string]: {
   431            b: 〈2;a〉
   432          }
   433        }
   434        a: {
   435          c: {
   436            b: {
   437              c: {
   438                b: {
   439                  c: {}
   440                }
   441              }
   442            }
   443          }
   444        }
   445      }
   446    }
   447    selfTriggerCycle: {
   448      issue1503: {
   449        a: (〈0;#T〉 & {
   450          a: {
   451            one: {
   452              link: {
   453                a: {
   454                  two: {}
   455                }
   456              }
   457            }
   458          }
   459        })
   460        #T: {
   461          a: {
   462            [string]: {
   463              link: 〈3;#T〉
   464            }
   465          }
   466          a: {
   467            b: {}
   468          }
   469        }
   470      }
   471    }
   472    mutuallyTriggeringCycle: {
   473      t1: {
   474        y: {
   475          [string]: {
   476            b: 〈2;y〉
   477          }
   478        }
   479        x: 〈0;y〉
   480        x: {
   481          c: 〈1;y〉
   482        }
   483      }
   484    }
   485  }
   486  --- issue3476.cue
   487  {
   488    issue3476: {
   489      #a: (〈0;#b〉 & {
   490        x: _
   491      }).x
   492      #b: {
   493        x?: 〈0;#c〉
   494        #c: {
   495          [string]: 〈1;#c〉
   496        }
   497      }
   498    }
   499  }
   500  --- issue3509.cue
   501  {
   502    issue3509: {
   503      out: (〈0;#job〉.step & "foo")
   504      #job: (〈0;#Workflow〉 & {
   505        job: _
   506      }).job
   507      #Workflow: {
   508        job: {
   509          step: string
   510        }
   511        #matrixConfig: ([
   512          ...〈1;#matrixConfig〉,
   513        ]|string)
   514        matrix?: {
   515          [string]: [
   516            ...〈2;#matrixConfig〉,
   517          ]
   518        }
   519      }
   520    }
   521  }
   522  --- ring.cue
   523  {
   524    brokenRing: {
   525      t1: {
   526        p1: {
   527          D: {
   528            a?: 〈1;T〉
   529          }
   530          T: {
   531            b: 〈1;D〉
   532          }
   533        }
   534        p2: {
   535          T: {
   536            b: 〈1;D〉
   537          }
   538          D: {
   539            a?: 〈1;T〉
   540          }
   541        }
   542      }
   543    }
   544    brokenRing: {
   545      t2: {
   546        p1: {
   547          D: {
   548            [string]: 〈1;T〉
   549          }
   550          T: {
   551            b: 〈1;D〉
   552          }
   553        }
   554      }
   555    }
   556    brokenRing: {
   557      t2: {
   558        p2: {
   559          T: {
   560            b: 〈1;D〉
   561          }
   562          D: {
   563            [string]: 〈1;T〉
   564          }
   565        }
   566      }
   567    }
   568    cyclicRing: {
   569      t1: {
   570        D: {
   571          a: 〈1;T〉
   572        }
   573        T: {
   574          b: 〈1;D〉
   575        }
   576      }
   577    }
   578  }
   579  -- out/eval/stats --
   580  Leaks:  2
   581  Freed:  193
   582  Reused: 182
   583  Allocs: 13
   584  Retain: 20
   585  
   586  Unifications: 193
   587  Conjuncts:    399
   588  Disjuncts:    213
   589  -- out/evalalpha --
   590  Errors:
   591  brokenRing.t1.p1.T.b: structural cycle
   592  cyclicRing.t1.T.b: structural cycle
   593  mutuallyTriggeringCycle.t1.x.c.b.b.b.b.b: structural cycle
   594  noCancelSelfInvoke.t1.x.c.b.b: structural cycle
   595  noCancelSelfInvoke.t1.x.c.c: structural cycle
   596  selfTriggerCycle.issue1503.#T.a.b.link: structural cycle
   597  selfTriggerCycle.long1.a.c.b.c.b.c.b: structural cycle
   598  selfTriggerCycle.t1.#T.b.b: structural cycle
   599  selfTriggerCycle.t2.b.c.a: structural cycle
   600  
   601  Result:
   602  (_|_){
   603    // [structural cycle]
   604    safeCycle: (struct){
   605      simple2: (struct){
   606        y: (struct){
   607        }
   608        x: (struct){
   609          c: (struct){
   610            b: (struct){
   611              c: (struct){
   612              }
   613              b: (struct){
   614                c: (struct){
   615                }
   616              }
   617            }
   618          }
   619        }
   620      }
   621      long1: (struct){
   622        y: (struct){
   623        }
   624        x: (struct){
   625          c: (struct){
   626            b: (struct){
   627              e: (struct){
   628                b: (struct){
   629                  c: (struct){
   630                    b: (struct){
   631                    }
   632                  }
   633                }
   634              }
   635            }
   636          }
   637        }
   638      }
   639      long2: (struct){
   640        a: (struct){
   641        }
   642        x: (struct){
   643          c: (struct){
   644            b: (struct){
   645              c: (struct){
   646                b: (struct){
   647                  c: (struct){
   648                    b: (struct){
   649                    }
   650                  }
   651                }
   652              }
   653            }
   654          }
   655        }
   656      }
   657    }
   658    noCyclePattern: (struct){
   659      t1: (struct){
   660        #D: (#struct){
   661        }
   662        a: (#struct){
   663          b: (#struct){
   664            c: (#struct){
   665            }
   666          }
   667        }
   668      }
   669      t2: (struct){
   670        #D: (#struct){
   671        }
   672        a: (#struct){
   673          b: (#struct){
   674            x: (#struct){
   675              c: (#struct){
   676                x: (#struct){
   677                }
   678              }
   679            }
   680          }
   681        }
   682      }
   683      t3: (struct){
   684        _D: (struct){
   685        }
   686        _T: (struct){
   687          x: (struct){
   688          }
   689        }
   690        a: (struct){
   691          b: (struct){
   692            x: (struct){
   693              c: (struct){
   694                x: (struct){
   695                }
   696              }
   697            }
   698          }
   699        }
   700      }
   701      t4: (struct){
   702        _D: (struct){
   703        }
   704        _T: (struct){
   705          y: (struct){
   706          }
   707        }
   708        a: (struct){
   709          b: (struct){
   710            x: (struct){
   711              y: (struct){
   712              }
   713            }
   714          }
   715        }
   716      }
   717      t5: (struct){
   718        _D: (struct){
   719        }
   720        _T: (struct){
   721          y: (struct){
   722          }
   723        }
   724        a: (struct){
   725          b: (struct){
   726            x: (struct){
   727              y: (struct){
   728                c: (struct){
   729                  x: (struct){
   730                    y: (struct){
   731                    }
   732                  }
   733                }
   734              }
   735            }
   736          }
   737        }
   738      }
   739      t6: (struct){
   740        #D: (#struct){
   741        }
   742        #E: (#struct){
   743          t: ~(noCyclePattern.t6.#T)
   744        }
   745        #T: (#struct){
   746          object: ~(noCyclePattern.t6.#S)
   747        }
   748        #S: (#struct){
   749          y: (#struct){
   750          }
   751        }
   752        bar: (struct){
   753          x: (#struct){
   754            r: (#struct){
   755              t: (#struct){
   756                object: (#struct){
   757                  y: (#struct){
   758                    foo: (#struct){
   759                      t: (#struct){
   760                        object: (#struct){
   761                          y: (#struct){
   762                          }
   763                        }
   764                      }
   765                    }
   766                  }
   767                }
   768              }
   769            }
   770          }
   771        }
   772      }
   773    }
   774    noCancelSelfInvoke: (_|_){
   775      // [structural cycle]
   776      t1: (_|_){
   777        // [structural cycle]
   778        y: (struct){
   779        }
   780        x: (_|_){
   781          // [structural cycle]
   782          c: (_|_){
   783            // [structural cycle]
   784            b: (_|_){
   785              // [structural cycle]
   786              b: (_|_){
   787                // [structural cycle] noCancelSelfInvoke.t1.x.c.b.b: structural cycle
   788              }
   789            }
   790            c: (_|_){
   791              // [structural cycle] noCancelSelfInvoke.t1.x.c.c: structural cycle
   792            }
   793          }
   794        }
   795      }
   796    }
   797    selfTriggerCycle: (_|_){
   798      // [structural cycle]
   799      t1: (_|_){
   800        // [structural cycle]
   801        a: ~(selfTriggerCycle.t1.#T)
   802        #T: (_|_){
   803          // [structural cycle]
   804          b: (_|_){
   805            // [structural cycle]
   806            b: (_|_){
   807              // [structural cycle] selfTriggerCycle.t1.#T.b.b: structural cycle
   808            }
   809          }
   810        }
   811      }
   812      t2: (_|_){
   813        // [structural cycle]
   814        #T: (#struct){
   815        }
   816        b: (_|_){
   817          // [structural cycle]
   818          c: (_|_){
   819            // [structural cycle]
   820            a: (_|_){
   821              // [structural cycle] selfTriggerCycle.t2.b.c.a: structural cycle
   822            }
   823          }
   824        }
   825      }
   826      long1: (_|_){
   827        // [structural cycle]
   828        a: (_|_){
   829          // [structural cycle]
   830          c: (_|_){
   831            // [structural cycle]
   832            b: (_|_){
   833              // [structural cycle]
   834              c: (_|_){
   835                // [structural cycle]
   836                b: (_|_){
   837                  // [structural cycle]
   838                  c: (_|_){
   839                    // [structural cycle]
   840                    b: (_|_){
   841                      // [structural cycle] selfTriggerCycle.long1.a.c.b.c.b.c.b: structural cycle
   842                    }
   843                  }
   844                }
   845              }
   846            }
   847          }
   848        }
   849      }
   850      issue1503: (_|_){
   851        // [structural cycle]
   852        a: (_|_){
   853          // [structural cycle]
   854          a: (_|_){
   855            // [structural cycle]
   856            one: (_|_){
   857              // [structural cycle]
   858              link: (_|_){
   859                // [structural cycle]
   860                a: (_|_){
   861                  // [structural cycle]
   862                  two: (_|_){
   863                    // [structural cycle]
   864                    link: ~(selfTriggerCycle.issue1503.#T)
   865                  }
   866                  b: (_|_){
   867                    // [structural cycle]
   868                    link: (_|_){
   869                      // [structural cycle]
   870                    }
   871                  }
   872                }
   873              }
   874            }
   875            b: (_|_){
   876              // [structural cycle]
   877              link: (_|_){
   878                // [structural cycle]
   879              }
   880            }
   881          }
   882        }
   883        #T: (_|_){
   884          // [structural cycle]
   885          a: (_|_){
   886            // [structural cycle]
   887            b: (_|_){
   888              // [structural cycle]
   889              link: (_|_){
   890                // [structural cycle] selfTriggerCycle.issue1503.#T.a.b.link: structural cycle
   891              }
   892            }
   893          }
   894        }
   895      }
   896    }
   897    mutuallyTriggeringCycle: (_|_){
   898      // [structural cycle]
   899      t1: (_|_){
   900        // [structural cycle]
   901        y: (struct){
   902        }
   903        x: (_|_){
   904          // [structural cycle]
   905          c: (_|_){
   906            // [structural cycle]
   907            b: (_|_){
   908              // [structural cycle]
   909              b: (_|_){
   910                // [structural cycle]
   911                b: (_|_){
   912                  // [structural cycle]
   913                  b: (_|_){
   914                    // [structural cycle]
   915                    b: (_|_){
   916                      // [structural cycle] mutuallyTriggeringCycle.t1.x.c.b.b.b.b.b: structural cycle
   917                    }
   918                  }
   919                }
   920              }
   921            }
   922          }
   923        }
   924      }
   925    }
   926    issue3476: (struct){
   927      #a: (#struct){
   928      }
   929      #b: (#struct){
   930        x?: (#struct){
   931        }
   932        #c: (#struct){
   933        }
   934      }
   935    }
   936    issue3509: (struct){
   937      out: (string){ "foo" }
   938      #job: (#struct){
   939        step: (string){ string }
   940      }
   941      #Workflow: (#struct){
   942        job: (#struct){
   943          step: (string){ string }
   944        }
   945        #matrixConfig: ((string|list)){ |((list){
   946          }, (string){ string }) }
   947        matrix?: (#struct){
   948        }
   949      }
   950    }
   951    brokenRing: (_|_){
   952      // [structural cycle]
   953      t1: (_|_){
   954        // [structural cycle]
   955        p1: (_|_){
   956          // [structural cycle]
   957          D: (struct){
   958            a?: ~(brokenRing.t1.p1.T)
   959          }
   960          T: (_|_){
   961            // [structural cycle]
   962            b: (_|_){
   963              // [structural cycle] brokenRing.t1.p1.T.b: structural cycle
   964            }
   965          }
   966        }
   967        p2: (struct){
   968          T: (struct){
   969            b: ~(brokenRing.t1.p2.D)
   970          }
   971          D: (struct){
   972            a?: (_|_){
   973              // [structural cycle] brokenRing.t1.p2.D.a: structural cycle
   974            }
   975          }
   976        }
   977      }
   978      t2: (struct){
   979        p1: (struct){
   980          D: (struct){
   981          }
   982          T: (struct){
   983            b: (struct){
   984            }
   985          }
   986        }
   987        p2: (struct){
   988          T: (struct){
   989            b: (struct){
   990            }
   991          }
   992          D: (struct){
   993          }
   994        }
   995      }
   996    }
   997    cyclicRing: (_|_){
   998      // [structural cycle]
   999      t1: (_|_){
  1000        // [structural cycle]
  1001        D: (_|_){
  1002          // [structural cycle]
  1003          a: ~(cyclicRing.t1.T)
  1004        }
  1005        T: (_|_){
  1006          // [structural cycle]
  1007          b: (_|_){
  1008            // [structural cycle] cyclicRing.t1.T.b: structural cycle
  1009          }
  1010        }
  1011      }
  1012    }
  1013  }
  1014  -- diff/-out/evalalpha<==>+out/eval --
  1015  diff old new
  1016  --- old
  1017  +++ new
  1018  @@ -1,12 +1,11 @@
  1019   Errors:
  1020   brokenRing.t1.p1.T.b: structural cycle
  1021  -cyclicRing.t1.D.a.b: structural cycle
  1022   cyclicRing.t1.T.b: structural cycle
  1023  -mutuallyTriggeringCycle.t1.x.c.b.b.b.b: structural cycle
  1024  -noCancelSelfInvoke.t1.x.c.b.b.b: structural cycle
  1025  +mutuallyTriggeringCycle.t1.x.c.b.b.b.b.b: structural cycle
  1026  +noCancelSelfInvoke.t1.x.c.b.b: structural cycle
  1027   noCancelSelfInvoke.t1.x.c.c: structural cycle
  1028   selfTriggerCycle.issue1503.#T.a.b.link: structural cycle
  1029  -selfTriggerCycle.long1.a.c.b.c.b.c.b.c.b: structural cycle
  1030  +selfTriggerCycle.long1.a.c.b.c.b.c.b: structural cycle
  1031   selfTriggerCycle.t1.#T.b.b: structural cycle
  1032   selfTriggerCycle.t2.b.c.a: structural cycle
  1033   
  1034  @@ -152,18 +151,10 @@
  1035         #D: (#struct){
  1036         }
  1037         #E: (#struct){
  1038  -        t: (#struct){
  1039  -          object: (#struct){
  1040  -            y: (#struct){
  1041  -            }
  1042  -          }
  1043  -        }
  1044  -      }
  1045  -      #T: (#struct){
  1046  -        object: (#struct){
  1047  -          y: (#struct){
  1048  -          }
  1049  -        }
  1050  +        t: ~(noCyclePattern.t6.#T)
  1051  +      }
  1052  +      #T: (#struct){
  1053  +        object: ~(noCyclePattern.t6.#S)
  1054         }
  1055         #S: (#struct){
  1056           y: (#struct){
  1057  @@ -201,18 +192,15 @@
  1058           // [structural cycle]
  1059           c: (_|_){
  1060             // [structural cycle]
  1061  +          b: (_|_){
  1062  +            // [structural cycle]
  1063  +            b: (_|_){
  1064  +              // [structural cycle] noCancelSelfInvoke.t1.x.c.b.b: structural cycle
  1065  +            }
  1066  +          }
  1067             c: (_|_){
  1068               // [structural cycle] noCancelSelfInvoke.t1.x.c.c: structural cycle
  1069             }
  1070  -          b: (_|_){
  1071  -            // [structural cycle]
  1072  -            b: (_|_){
  1073  -              // [structural cycle]
  1074  -              b: (_|_){
  1075  -                // [structural cycle] noCancelSelfInvoke.t1.x.c.b.b.b: structural cycle
  1076  -              }
  1077  -            }
  1078  -          }
  1079           }
  1080         }
  1081       }
  1082  @@ -221,12 +209,7 @@
  1083       // [structural cycle]
  1084       t1: (_|_){
  1085         // [structural cycle]
  1086  -      a: (_|_){
  1087  -        // [structural cycle]
  1088  -        b: (_|_){
  1089  -          // [structural cycle]
  1090  -        }
  1091  -      }
  1092  +      a: ~(selfTriggerCycle.t1.#T)
  1093         #T: (_|_){
  1094           // [structural cycle]
  1095           b: (_|_){
  1096  @@ -266,13 +249,7 @@
  1097                   c: (_|_){
  1098                     // [structural cycle]
  1099                     b: (_|_){
  1100  -                    // [structural cycle]
  1101  -                    c: (_|_){
  1102  -                      // [structural cycle]
  1103  -                      b: (_|_){
  1104  -                        // [structural cycle] selfTriggerCycle.long1.a.c.b.c.b.c.b.c.b: structural cycle
  1105  -                      }
  1106  -                    }
  1107  +                    // [structural cycle] selfTriggerCycle.long1.a.c.b.c.b.c.b: structural cycle
  1108                     }
  1109                   }
  1110                 }
  1111  @@ -287,20 +264,29 @@
  1112           // [structural cycle]
  1113           a: (_|_){
  1114             // [structural cycle]
  1115  -          b: (_|_){
  1116  -            // [structural cycle]
  1117  -            link: (_|_){
  1118  -              // [structural cycle]
  1119  -            }
  1120  -          }
  1121             one: (_|_){
  1122               // [structural cycle]
  1123               link: (_|_){
  1124                 // [structural cycle]
  1125  -              a: (struct){
  1126  -                two: (struct){
  1127  -                }
  1128  -              }
  1129  +              a: (_|_){
  1130  +                // [structural cycle]
  1131  +                two: (_|_){
  1132  +                  // [structural cycle]
  1133  +                  link: ~(selfTriggerCycle.issue1503.#T)
  1134  +                }
  1135  +                b: (_|_){
  1136  +                  // [structural cycle]
  1137  +                  link: (_|_){
  1138  +                    // [structural cycle]
  1139  +                  }
  1140  +                }
  1141  +              }
  1142  +            }
  1143  +          }
  1144  +          b: (_|_){
  1145  +            // [structural cycle]
  1146  +            link: (_|_){
  1147  +              // [structural cycle]
  1148               }
  1149             }
  1150           }
  1151  @@ -336,7 +322,10 @@
  1152                 b: (_|_){
  1153                   // [structural cycle]
  1154                   b: (_|_){
  1155  -                  // [structural cycle] mutuallyTriggeringCycle.t1.x.c.b.b.b.b: structural cycle
  1156  +                  // [structural cycle]
  1157  +                  b: (_|_){
  1158  +                    // [structural cycle] mutuallyTriggeringCycle.t1.x.c.b.b.b.b.b: structural cycle
  1159  +                  }
  1160                   }
  1161                 }
  1162               }
  1163  @@ -377,12 +366,7 @@
  1164         p1: (_|_){
  1165           // [structural cycle]
  1166           D: (struct){
  1167  -          a?: (_|_){
  1168  -            // [structural cycle]
  1169  -            b: (_|_){
  1170  -              // [structural cycle] brokenRing.t1.p1.D.a.b: structural cycle
  1171  -            }
  1172  -          }
  1173  +          a?: ~(brokenRing.t1.p1.T)
  1174           }
  1175           T: (_|_){
  1176             // [structural cycle]
  1177  @@ -393,11 +377,7 @@
  1178         }
  1179         p2: (struct){
  1180           T: (struct){
  1181  -          b: (struct){
  1182  -            a?: (_|_){
  1183  -              // [structural cycle] brokenRing.t1.p2.T.b.a: structural cycle
  1184  -            }
  1185  -          }
  1186  +          b: ~(brokenRing.t1.p2.D)
  1187           }
  1188           D: (struct){
  1189             a?: (_|_){
  1190  @@ -431,12 +411,7 @@
  1191         // [structural cycle]
  1192         D: (_|_){
  1193           // [structural cycle]
  1194  -        a: (_|_){
  1195  -          // [structural cycle]
  1196  -          b: (_|_){
  1197  -            // [structural cycle] cyclicRing.t1.D.a.b: structural cycle
  1198  -          }
  1199  -        }
  1200  +        a: ~(cyclicRing.t1.T)
  1201         }
  1202         T: (_|_){
  1203           // [structural cycle]
  1204  -- diff/todo/p2 --
  1205  selfTriggerCycle.t1.a.b.b: cycle detected slightly too late
  1206  -- out/eval --
  1207  Errors:
  1208  brokenRing.t1.p1.T.b: structural cycle
  1209  cyclicRing.t1.D.a.b: structural cycle
  1210  cyclicRing.t1.T.b: structural cycle
  1211  mutuallyTriggeringCycle.t1.x.c.b.b.b.b: structural cycle
  1212  noCancelSelfInvoke.t1.x.c.b.b.b: structural cycle
  1213  noCancelSelfInvoke.t1.x.c.c: structural cycle
  1214  selfTriggerCycle.issue1503.#T.a.b.link: structural cycle
  1215  selfTriggerCycle.long1.a.c.b.c.b.c.b.c.b: structural cycle
  1216  selfTriggerCycle.t1.#T.b.b: structural cycle
  1217  selfTriggerCycle.t2.b.c.a: structural cycle
  1218  
  1219  Result:
  1220  (_|_){
  1221    // [structural cycle]
  1222    safeCycle: (struct){
  1223      simple2: (struct){
  1224        y: (struct){
  1225        }
  1226        x: (struct){
  1227          c: (struct){
  1228            b: (struct){
  1229              c: (struct){
  1230              }
  1231              b: (struct){
  1232                c: (struct){
  1233                }
  1234              }
  1235            }
  1236          }
  1237        }
  1238      }
  1239      long1: (struct){
  1240        y: (struct){
  1241        }
  1242        x: (struct){
  1243          c: (struct){
  1244            b: (struct){
  1245              e: (struct){
  1246                b: (struct){
  1247                  c: (struct){
  1248                    b: (struct){
  1249                    }
  1250                  }
  1251                }
  1252              }
  1253            }
  1254          }
  1255        }
  1256      }
  1257      long2: (struct){
  1258        a: (struct){
  1259        }
  1260        x: (struct){
  1261          c: (struct){
  1262            b: (struct){
  1263              c: (struct){
  1264                b: (struct){
  1265                  c: (struct){
  1266                    b: (struct){
  1267                    }
  1268                  }
  1269                }
  1270              }
  1271            }
  1272          }
  1273        }
  1274      }
  1275    }
  1276    noCyclePattern: (struct){
  1277      t1: (struct){
  1278        #D: (#struct){
  1279        }
  1280        a: (#struct){
  1281          b: (#struct){
  1282            c: (#struct){
  1283            }
  1284          }
  1285        }
  1286      }
  1287      t2: (struct){
  1288        #D: (#struct){
  1289        }
  1290        a: (#struct){
  1291          b: (#struct){
  1292            x: (#struct){
  1293              c: (#struct){
  1294                x: (#struct){
  1295                }
  1296              }
  1297            }
  1298          }
  1299        }
  1300      }
  1301      t3: (struct){
  1302        _D: (struct){
  1303        }
  1304        _T: (struct){
  1305          x: (struct){
  1306          }
  1307        }
  1308        a: (struct){
  1309          b: (struct){
  1310            x: (struct){
  1311              c: (struct){
  1312                x: (struct){
  1313                }
  1314              }
  1315            }
  1316          }
  1317        }
  1318      }
  1319      t4: (struct){
  1320        _D: (struct){
  1321        }
  1322        _T: (struct){
  1323          y: (struct){
  1324          }
  1325        }
  1326        a: (struct){
  1327          b: (struct){
  1328            x: (struct){
  1329              y: (struct){
  1330              }
  1331            }
  1332          }
  1333        }
  1334      }
  1335      t5: (struct){
  1336        _D: (struct){
  1337        }
  1338        _T: (struct){
  1339          y: (struct){
  1340          }
  1341        }
  1342        a: (struct){
  1343          b: (struct){
  1344            x: (struct){
  1345              y: (struct){
  1346                c: (struct){
  1347                  x: (struct){
  1348                    y: (struct){
  1349                    }
  1350                  }
  1351                }
  1352              }
  1353            }
  1354          }
  1355        }
  1356      }
  1357      t6: (struct){
  1358        #D: (#struct){
  1359        }
  1360        #E: (#struct){
  1361          t: (#struct){
  1362            object: (#struct){
  1363              y: (#struct){
  1364              }
  1365            }
  1366          }
  1367        }
  1368        #T: (#struct){
  1369          object: (#struct){
  1370            y: (#struct){
  1371            }
  1372          }
  1373        }
  1374        #S: (#struct){
  1375          y: (#struct){
  1376          }
  1377        }
  1378        bar: (struct){
  1379          x: (#struct){
  1380            r: (#struct){
  1381              t: (#struct){
  1382                object: (#struct){
  1383                  y: (#struct){
  1384                    foo: (#struct){
  1385                      t: (#struct){
  1386                        object: (#struct){
  1387                          y: (#struct){
  1388                          }
  1389                        }
  1390                      }
  1391                    }
  1392                  }
  1393                }
  1394              }
  1395            }
  1396          }
  1397        }
  1398      }
  1399    }
  1400    noCancelSelfInvoke: (_|_){
  1401      // [structural cycle]
  1402      t1: (_|_){
  1403        // [structural cycle]
  1404        y: (struct){
  1405        }
  1406        x: (_|_){
  1407          // [structural cycle]
  1408          c: (_|_){
  1409            // [structural cycle]
  1410            c: (_|_){
  1411              // [structural cycle] noCancelSelfInvoke.t1.x.c.c: structural cycle
  1412            }
  1413            b: (_|_){
  1414              // [structural cycle]
  1415              b: (_|_){
  1416                // [structural cycle]
  1417                b: (_|_){
  1418                  // [structural cycle] noCancelSelfInvoke.t1.x.c.b.b.b: structural cycle
  1419                }
  1420              }
  1421            }
  1422          }
  1423        }
  1424      }
  1425    }
  1426    selfTriggerCycle: (_|_){
  1427      // [structural cycle]
  1428      t1: (_|_){
  1429        // [structural cycle]
  1430        a: (_|_){
  1431          // [structural cycle]
  1432          b: (_|_){
  1433            // [structural cycle]
  1434          }
  1435        }
  1436        #T: (_|_){
  1437          // [structural cycle]
  1438          b: (_|_){
  1439            // [structural cycle]
  1440            b: (_|_){
  1441              // [structural cycle] selfTriggerCycle.t1.#T.b.b: structural cycle
  1442            }
  1443          }
  1444        }
  1445      }
  1446      t2: (_|_){
  1447        // [structural cycle]
  1448        #T: (#struct){
  1449        }
  1450        b: (_|_){
  1451          // [structural cycle]
  1452          c: (_|_){
  1453            // [structural cycle]
  1454            a: (_|_){
  1455              // [structural cycle] selfTriggerCycle.t2.b.c.a: structural cycle
  1456            }
  1457          }
  1458        }
  1459      }
  1460      long1: (_|_){
  1461        // [structural cycle]
  1462        a: (_|_){
  1463          // [structural cycle]
  1464          c: (_|_){
  1465            // [structural cycle]
  1466            b: (_|_){
  1467              // [structural cycle]
  1468              c: (_|_){
  1469                // [structural cycle]
  1470                b: (_|_){
  1471                  // [structural cycle]
  1472                  c: (_|_){
  1473                    // [structural cycle]
  1474                    b: (_|_){
  1475                      // [structural cycle]
  1476                      c: (_|_){
  1477                        // [structural cycle]
  1478                        b: (_|_){
  1479                          // [structural cycle] selfTriggerCycle.long1.a.c.b.c.b.c.b.c.b: structural cycle
  1480                        }
  1481                      }
  1482                    }
  1483                  }
  1484                }
  1485              }
  1486            }
  1487          }
  1488        }
  1489      }
  1490      issue1503: (_|_){
  1491        // [structural cycle]
  1492        a: (_|_){
  1493          // [structural cycle]
  1494          a: (_|_){
  1495            // [structural cycle]
  1496            b: (_|_){
  1497              // [structural cycle]
  1498              link: (_|_){
  1499                // [structural cycle]
  1500              }
  1501            }
  1502            one: (_|_){
  1503              // [structural cycle]
  1504              link: (_|_){
  1505                // [structural cycle]
  1506                a: (struct){
  1507                  two: (struct){
  1508                  }
  1509                }
  1510              }
  1511            }
  1512          }
  1513        }
  1514        #T: (_|_){
  1515          // [structural cycle]
  1516          a: (_|_){
  1517            // [structural cycle]
  1518            b: (_|_){
  1519              // [structural cycle]
  1520              link: (_|_){
  1521                // [structural cycle] selfTriggerCycle.issue1503.#T.a.b.link: structural cycle
  1522              }
  1523            }
  1524          }
  1525        }
  1526      }
  1527    }
  1528    mutuallyTriggeringCycle: (_|_){
  1529      // [structural cycle]
  1530      t1: (_|_){
  1531        // [structural cycle]
  1532        y: (struct){
  1533        }
  1534        x: (_|_){
  1535          // [structural cycle]
  1536          c: (_|_){
  1537            // [structural cycle]
  1538            b: (_|_){
  1539              // [structural cycle]
  1540              b: (_|_){
  1541                // [structural cycle]
  1542                b: (_|_){
  1543                  // [structural cycle]
  1544                  b: (_|_){
  1545                    // [structural cycle] mutuallyTriggeringCycle.t1.x.c.b.b.b.b: structural cycle
  1546                  }
  1547                }
  1548              }
  1549            }
  1550          }
  1551        }
  1552      }
  1553    }
  1554    issue3476: (struct){
  1555      #a: (#struct){
  1556      }
  1557      #b: (#struct){
  1558        x?: (#struct){
  1559        }
  1560        #c: (#struct){
  1561        }
  1562      }
  1563    }
  1564    issue3509: (struct){
  1565      out: (string){ "foo" }
  1566      #job: (#struct){
  1567        step: (string){ string }
  1568      }
  1569      #Workflow: (#struct){
  1570        job: (#struct){
  1571          step: (string){ string }
  1572        }
  1573        #matrixConfig: ((string|list)){ |((list){
  1574          }, (string){ string }) }
  1575        matrix?: (#struct){
  1576        }
  1577      }
  1578    }
  1579    brokenRing: (_|_){
  1580      // [structural cycle]
  1581      t1: (_|_){
  1582        // [structural cycle]
  1583        p1: (_|_){
  1584          // [structural cycle]
  1585          D: (struct){
  1586            a?: (_|_){
  1587              // [structural cycle]
  1588              b: (_|_){
  1589                // [structural cycle] brokenRing.t1.p1.D.a.b: structural cycle
  1590              }
  1591            }
  1592          }
  1593          T: (_|_){
  1594            // [structural cycle]
  1595            b: (_|_){
  1596              // [structural cycle] brokenRing.t1.p1.T.b: structural cycle
  1597            }
  1598          }
  1599        }
  1600        p2: (struct){
  1601          T: (struct){
  1602            b: (struct){
  1603              a?: (_|_){
  1604                // [structural cycle] brokenRing.t1.p2.T.b.a: structural cycle
  1605              }
  1606            }
  1607          }
  1608          D: (struct){
  1609            a?: (_|_){
  1610              // [structural cycle] brokenRing.t1.p2.D.a: structural cycle
  1611            }
  1612          }
  1613        }
  1614      }
  1615      t2: (struct){
  1616        p1: (struct){
  1617          D: (struct){
  1618          }
  1619          T: (struct){
  1620            b: (struct){
  1621            }
  1622          }
  1623        }
  1624        p2: (struct){
  1625          T: (struct){
  1626            b: (struct){
  1627            }
  1628          }
  1629          D: (struct){
  1630          }
  1631        }
  1632      }
  1633    }
  1634    cyclicRing: (_|_){
  1635      // [structural cycle]
  1636      t1: (_|_){
  1637        // [structural cycle]
  1638        D: (_|_){
  1639          // [structural cycle]
  1640          a: (_|_){
  1641            // [structural cycle]
  1642            b: (_|_){
  1643              // [structural cycle] cyclicRing.t1.D.a.b: structural cycle
  1644            }
  1645          }
  1646        }
  1647        T: (_|_){
  1648          // [structural cycle]
  1649          b: (_|_){
  1650            // [structural cycle] cyclicRing.t1.T.b: structural cycle
  1651          }
  1652        }
  1653      }
  1654    }
  1655  }