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

     1  -- in.cue --
     2  import "regexp"
     3  
     4  // Issue #655
     5  // When evaluating a value into a struct, and then back into a value, the
     6  // evaluation mode flips from Partial to AllConjunctsDone to Back. This is
     7  // typically not an issue, but if a referred field is within a struct generated
     8  // by a builtin, effectively the entire struct needs to be evaluated and special
     9  // care should be taking to not evaluate too early.
    10  builtinCyclePerm0: {
    11  	X: "mod.test"
    12  
    13  	Y: {
    14  		#components: regexp.FindNamedSubmatch(#"^(?P<host>[[:alnum:].]+)$"#, X)
    15  		host:        #components.host
    16  	}
    17  
    18  	X: Y.host
    19  }
    20  
    21  builtinCyclePerm1: {
    22  	X: Y.host
    23  
    24  	Y: {
    25  		#components: regexp.FindNamedSubmatch(#"^(?P<host>[[:alnum:].]+)$"#, X)
    26  		host:        #components.host
    27  	}
    28  
    29  	X: "mod.test"
    30  }
    31  
    32  builtinCyclePerm2: {
    33  	Y: {
    34  		#components: regexp.FindNamedSubmatch(#"^(?P<host>[[:alnum:].]+)$"#, X)
    35  		host:        #components.host
    36  	}
    37  
    38  	X: Y.host
    39  	X: "mod.test"
    40  }
    41  
    42  builtinCyclePerm3: {
    43  	Y: {
    44  		#components: regexp.FindNamedSubmatch(#"^(?P<host>[[:alnum:].]+)$"#, X)
    45  		host:        #components.host
    46  	}
    47  
    48  	X: "mod.test"
    49  	X: Y.host
    50  }
    51  
    52  builtinCyclePerm4: {
    53  	X: "mod.test"
    54  	X: Y.host
    55  
    56  	Y: {
    57  		#components: regexp.FindNamedSubmatch(#"^(?P<host>[[:alnum:].]+)$"#, X)
    58  		host:        #components.host
    59  	}
    60  }
    61  
    62  builtinCyclePerm5: {
    63  	X: Y.host
    64  	X: "mod.test"
    65  
    66  	Y: {
    67  		#components: regexp.FindNamedSubmatch(#"^(?P<host>[[:alnum:].]+)$"#, X)
    68  		host:        #components.host
    69  	}
    70  }
    71  -- matchn.cue --
    72  // This should not be a structural cycle, as the list type is "optional".
    73  issue3410: {
    74  	_s
    75  	_s: {
    76  		#x: matchN(1, [_s, [..._s]])
    77  	}
    78  }
    79  issue3420: {
    80  	matches1: {
    81  		#S: matchN(1, [_, _|_])
    82  		s: 2
    83  	}
    84  }
    85  issue3443: {
    86  	matchIf: {
    87  		#S: matchIf({x?: "b"}, {n?: #S & (int | {})}, _)
    88  	}
    89  	noCycle: {
    90  		// This is not a structural cycle, and should not hang, as n? is optional.
    91  		#S: matchN(1, [{n?: #S & (int | {})}])
    92  
    93  		noHang: {
    94  			s: #S
    95  			s: n: n: _
    96  		}
    97  	}
    98  
    99  	noCycle2: {
   100  		#S: matchN(1, [{n?: (int | #S)}])
   101  	}
   102  
   103  	cycle1: {
   104  		// This correct CUE, as matchN allows for schema to be errors. We should
   105  		// probably have a vet rule to catch this,though.
   106  		#S: matchN(1, [{n: #S}])
   107  
   108  		// This is not an error as the result is structure shared. Not sure if
   109  		// this should be accepted.
   110  		ok: {
   111  			s: #S
   112  			s: _
   113  		}
   114  
   115  		// This unifies deep enough to cause a structural cycle. It probably
   116  		// should not.
   117  		cycle: {
   118  			s: #S
   119  			s: n: n: _
   120  		}
   121  	}
   122  
   123  	cycle2: {
   124  		// TODO: this should probably fail, or at least be consistent with
   125  		// cycle1.cycle.
   126  		fail: #S: matchN(1, [{n: #S}]) & {n: n: n: _}
   127  	}
   128  }
   129  issue3633: final: {
   130  	// With nested matchNs as below, the schema will become an incomplete error
   131  	// as a value of the root vertex. Make sure this edge case is properly
   132  	// handled.
   133  	data: {} & #s
   134  	#s: matchN(1, [matchN(1, [{a!: _}])])
   135  }
   136  -- cycle.cue --
   137  noCycle: t1: {
   138  	_s
   139  	_s: {
   140  		#x: matchN(1, [_s])
   141          #x: {} // insert concrete value to trigger application of validator.
   142  	}
   143  }
   144  issue3649: noCycle: t1: {
   145  	data: #c
   146  	data: a: b: "foo"
   147  	#c: {
   148  		// There should be no cycle because of these optional fields.
   149  		b?: string
   150  		a?: matchN(1, [#c])
   151  	}
   152  }
   153  // Same as above, but with longer paths.
   154  issue3649: noCycle: t2: {
   155  	x: c
   156  	x: y: a: d: b: "foo"
   157  	c: {
   158  		b?: string
   159  		y: a?: matchN(1, [{d: c}])
   160  	}
   161  }
   162  issue3649: cycle: t1: {
   163  	data: #c
   164  	data: a: b: "foo"
   165  	#c: {
   166  		b: string
   167  		a: matchN(1, [#c])
   168  	}
   169  }
   170  -- yamlcycle.cue --
   171  import "encoding/yaml"
   172  
   173  yamlNoCycle: {
   174  	// the validator is invoked recursively and also unifies with a concrete
   175  	// value. This should nonetheless not result in a cycle error.
   176      #c: {
   177          b?: string
   178          a?: yaml.Validate(#c)
   179      }
   180      data: #c
   181      data: a: #"{a: "b: foo"}"#
   182  }
   183  selfCycle: t1: {
   184  	c: matchN(1, [{d: c}])
   185  	c: d: {}
   186  }
   187  selfCycle: t2: {
   188  	// Even though only part of the path is unified with concrete data, this
   189  	// should still result in a cycle error.
   190  	c: matchN(1, [{d: c}])
   191  	c: {}
   192  }
   193  selfCycle: yamlVal: t1: {
   194  	x: y: yaml.Validate(x)
   195  	x: y: "{}"
   196  }
   197  selfCycle: yamlVal: t2: {
   198  	// Duplicating validators can cause some tricky code paths, like finalizing
   199  	// a node while still in the middle of validation.
   200  	x: y: yaml.Validate(x)
   201  	x: y: "{}"
   202  	x: y: yaml.Validate(x)
   203  	x: y: "{}"
   204  }
   205  selfCycle: yamlFun: t1:{
   206  	x: y?: yaml.Validate("{}", x)
   207  }
   208  selfCycle: yamlFun: t2: {
   209  	z: x & __no_sharing
   210  	z: y: "{}"
   211  	x: y: yaml.Validate("{}", x)
   212  }
   213  selfCycle: yamlValidatePartial: {
   214  	x: y: yaml.ValidatePartial(x)
   215  	x: y: "{}"
   216  }
   217  -- jsoncycle.cue --
   218  import "encoding/json"
   219  
   220  jsonCycle: t1: {
   221  	x: y: json.Validate(x)
   222  	x: y: "{}"
   223  }
   224  -- listmatchncycle.cue --
   225  import "list"
   226  
   227  listMatchN: structCycle: {
   228  	x: y: list.MatchN(1, x)
   229  	x: y: [{}]
   230  }
   231  listMatchN: ok: {
   232  	x: y?: list.MatchN(1, x)
   233      z: x
   234  	z: y: [{}]
   235  }
   236  -- issue3634.cue --
   237  import "list"
   238  
   239  issue3634: full: {
   240  	#Schema: {
   241  		required?: [...string] 
   242  		properties?: [string]: null | #Schema
   243  	}
   244  	
   245  	out: len([...#Schema] & list.Repeat([{
   246  		#Schema // removing this fixes the bug!
   247  		properties: foo: required: ["bar", "baz"]
   248  	}], 3))
   249  }
   250  issue3634: reduced: {
   251  	#D: {
   252  		b?: int
   253  		a?: #D
   254  	}
   255  	out: len(#D & list.Repeat([#D & { a: b: 1 }], 1)[0])
   256  }
   257  -- out/evalalpha/stats --
   258  Leaks:  478
   259  Freed:  0
   260  Reused: 0
   261  Allocs: 478
   262  Retain: 0
   263  
   264  Unifications: 407
   265  Conjuncts:    745
   266  Disjuncts:    42
   267  
   268  CloseIDElems: 122
   269  NumCloseIDs: 191
   270  -- diff/-out/evalalpha/stats<==>+out/eval/stats --
   271  diff old new
   272  --- old
   273  +++ new
   274  @@ -1,9 +1,12 @@
   275  -Leaks:  25
   276  -Freed:  446
   277  -Reused: 434
   278  -Allocs: 37
   279  -Retain: 99
   280  -
   281  -Unifications: 441
   282  -Conjuncts:    821
   283  -Disjuncts:    537
   284  +Leaks:  478
   285  +Freed:  0
   286  +Reused: 0
   287  +Allocs: 478
   288  +Retain: 0
   289  +
   290  +Unifications: 407
   291  +Conjuncts:    745
   292  +Disjuncts:    42
   293  +
   294  +CloseIDElems: 122
   295  +NumCloseIDs: 191
   296  -- out/eval/stats --
   297  Leaks:  25
   298  Freed:  446
   299  Reused: 434
   300  Allocs: 37
   301  Retain: 99
   302  
   303  Unifications: 441
   304  Conjuncts:    821
   305  Disjuncts:    537
   306  -- out/evalalpha --
   307  Errors:
   308  noCycle.t1.#x: invalid value {} (does not satisfy matchN): 0 matched, expected 1:
   309      ./cycle.cue:4:7
   310      ./cycle.cue:4:14
   311      ./cycle.cue:5:13
   312  noCycle.t1.#x.#x: structural cycle:
   313      ./cycle.cue:4:7
   314  noCycle.t1._s.#x: invalid value {} (does not satisfy matchN): 0 matched, expected 1:
   315      ./cycle.cue:4:7
   316      ./cycle.cue:4:14
   317      ./cycle.cue:5:13
   318  issue3649.cycle.t1.data.a: invalid value {b:"foo"} (does not satisfy matchN): 0 matched, expected 1:
   319      ./cycle.cue:31:6
   320      ./cycle.cue:28:11
   321      ./cycle.cue:31:13
   322  issue3649.cycle.t1.data.a.a: structural cycle:
   323      ./cycle.cue:31:6
   324  jsonCycle.t1.x.y: invalid value "{}" (does not satisfy encoding/json.Validate): error in call to encoding/json.Validate: structural cycle:
   325      ./jsoncycle.cue:4:8
   326      ./jsoncycle.cue:5:8
   327  listMatchN.structCycle.x.y: invalid value [{}] (does not satisfy list.MatchN): number of matched elements is 0: does not satisfy 1:
   328      ./listmatchncycle.cue:4:8
   329      ./listmatchncycle.cue:4:20
   330      ./listmatchncycle.cue:5:8
   331  issue3443.matchIf.#S: cannot call non-function matchIf (type struct):
   332      ./matchn.cue:16:7
   333  issue3443.cycle1.cycle.s: invalid value {n:{n:_}} (does not satisfy matchN): 0 matched, expected 1:
   334      ./matchn.cue:35:7
   335      ./matchn.cue:35:14
   336      ./matchn.cue:47:7
   337      ./matchn.cue:48:7
   338  issue3443.cycle1.cycle.s.n: invalid value {n:_} (does not satisfy matchN): 0 matched, expected 1:
   339      ./matchn.cue:35:7
   340      ./matchn.cue:35:14
   341      ./matchn.cue:35:22
   342      ./matchn.cue:48:10
   343  issue3443.cycle1.cycle.s.n.n: structural cycle:
   344      ./matchn.cue:35:7
   345  issue3443.cycle2.fail.#S: invalid value {n:{n:{n:_}}} (does not satisfy matchN): 0 matched, expected 1:
   346      ./matchn.cue:55:13
   347      ./matchn.cue:55:20
   348  issue3443.cycle2.fail.#S.n: invalid value {n:{n:{n:_}}} (does not satisfy matchN): 0 matched, expected 1:
   349      ./matchn.cue:55:13
   350      ./matchn.cue:55:20
   351      ./matchn.cue:55:28
   352      ./matchn.cue:55:40
   353  issue3443.cycle2.fail.#S.n.n: invalid value {n:{n:{n:_}}} (does not satisfy matchN): 0 matched, expected 1:
   354      ./matchn.cue:55:13
   355      ./matchn.cue:55:20
   356      ./matchn.cue:55:28
   357      ./matchn.cue:55:40
   358      ./matchn.cue:55:43
   359  issue3443.cycle2.fail.#S.n.n.n: structural cycle:
   360      ./matchn.cue:55:13
   361  selfCycle.t1.c: invalid value {d:{}} (does not satisfy matchN): 0 matched, expected 1:
   362      ./yamlcycle.cue:14:5
   363      ./yamlcycle.cue:14:12
   364      ./yamlcycle.cue:15:5
   365  selfCycle.t1.c.d: invalid value {d:{}} (does not satisfy matchN): 0 matched, expected 1:
   366      ./yamlcycle.cue:14:5
   367      ./yamlcycle.cue:14:12
   368      ./yamlcycle.cue:14:20
   369      ./yamlcycle.cue:15:8
   370  selfCycle.t1.c.d.d: invalid value {d:{}} (does not satisfy matchN): 0 matched, expected 1:
   371      ./yamlcycle.cue:14:5
   372      ./yamlcycle.cue:14:12
   373      ./yamlcycle.cue:14:20
   374      ./yamlcycle.cue:15:8
   375  selfCycle.t1.c.d.d.d: structural cycle:
   376      ./yamlcycle.cue:14:5
   377  selfCycle.yamlVal.t1.x.y: invalid value "{}" (does not satisfy encoding/yaml.Validate): error in call to encoding/yaml.Validate: structural cycle:
   378      ./yamlcycle.cue:24:8
   379      ./yamlcycle.cue:25:8
   380  selfCycle.yamlVal.t2.x.y: invalid value "{}" (does not satisfy encoding/yaml.Validate): error in call to encoding/yaml.Validate: structural cycle:
   381      ./yamlcycle.cue:30:8
   382      ./yamlcycle.cue:31:8
   383      ./yamlcycle.cue:32:8
   384      ./yamlcycle.cue:33:8
   385  selfCycle.yamlFun.t2.x.y: error in call to encoding/yaml.Validate: structural cycle:
   386      ./yamlcycle.cue:41:8
   387  selfCycle.yamlFun.t2.z.y: error in call to encoding/yaml.Validate: structural cycle:
   388      ./yamlcycle.cue:41:8
   389  selfCycle.yamlValidatePartial.x.y: invalid value "{}" (does not satisfy encoding/yaml.ValidatePartial): error in call to encoding/yaml.ValidatePartial: structural cycle:
   390      ./yamlcycle.cue:44:8
   391      ./yamlcycle.cue:45:8
   392  
   393  Result:
   394  (_|_){
   395    // [eval]
   396    noCycle: (_|_){
   397      // [eval]
   398      t1: (_|_){
   399        // [eval]
   400        _s: (_|_){
   401          // [eval]
   402          #x: (_|_){
   403            // [eval] noCycle.t1._s.#x: invalid value {} (does not satisfy matchN): 0 matched, expected 1:
   404            //     ./cycle.cue:4:7
   405            //     ./cycle.cue:4:14
   406            //     ./cycle.cue:5:13
   407          }
   408        }
   409        #x: (_|_){
   410          // [eval] noCycle.t1.#x: invalid value {} (does not satisfy matchN): 0 matched, expected 1:
   411          //     ./cycle.cue:4:7
   412          //     ./cycle.cue:4:14
   413          //     ./cycle.cue:5:13
   414          // noCycle.t1.#x.#x: structural cycle:
   415          //     ./cycle.cue:4:7
   416        }
   417      }
   418    }
   419    issue3649: (_|_){
   420      // [eval]
   421      noCycle: (struct){
   422        t1: (struct){
   423          data: (#struct){
   424            a: (#struct){
   425              b: (string){ "foo" }
   426            }
   427            b?: (string){ string }
   428          }
   429          #c: (#struct){
   430            b?: (string){ string }
   431            a?: (_){ matchN(1, (#list){
   432                0: (_|_){// 〈2;#c〉
   433                }
   434              }) }
   435          }
   436        }
   437        t2: (struct){
   438          x: (struct){
   439            y: (struct){
   440              a: (struct){
   441                d: (struct){
   442                  b: (string){ "foo" }
   443                }
   444              }
   445            }
   446            b?: (string){ string }
   447          }
   448          c: (struct){
   449            b?: (string){ string }
   450            y: (struct){
   451              a?: (_){ matchN(1, (#list){
   452                  0: (_|_){// {
   453                    //   d: 〈4;c〉
   454                    // }
   455                  }
   456                }) }
   457            }
   458          }
   459        }
   460      }
   461      cycle: (_|_){
   462        // [eval]
   463        t1: (_|_){
   464          // [eval]
   465          data: (_|_){
   466            // [eval]
   467            a: (_|_){
   468              // [eval] issue3649.cycle.t1.data.a: invalid value {b:"foo"} (does not satisfy matchN): 0 matched, expected 1:
   469              //     ./cycle.cue:31:6
   470              //     ./cycle.cue:28:11
   471              //     ./cycle.cue:31:13
   472              // issue3649.cycle.t1.data.a.a: structural cycle:
   473              //     ./cycle.cue:31:6
   474              b: (string){ "foo" }
   475            }
   476            b: (string){ string }
   477          }
   478          #c: (#struct){
   479            b: (string){ string }
   480            a: (_){ matchN(1, (#list){
   481                0: (_|_){// 〈2;#c〉
   482                }
   483              }) }
   484          }
   485        }
   486      }
   487    }
   488    builtinCyclePerm0: (struct){
   489      X: (string){ "mod.test" }
   490      Y: (struct){
   491        #components: (#struct){
   492          host: (string){ "mod.test" }
   493        }
   494        host: (string){ "mod.test" }
   495      }
   496    }
   497    builtinCyclePerm1: (struct){
   498      X: (string){ "mod.test" }
   499      Y: (struct){
   500        #components: (#struct){
   501          host: (string){ "mod.test" }
   502        }
   503        host: (string){ "mod.test" }
   504      }
   505    }
   506    builtinCyclePerm2: (struct){
   507      Y: (struct){
   508        #components: (#struct){
   509          host: (string){ "mod.test" }
   510        }
   511        host: (string){ "mod.test" }
   512      }
   513      X: (string){ "mod.test" }
   514    }
   515    builtinCyclePerm3: (struct){
   516      Y: (struct){
   517        #components: (#struct){
   518          host: (string){ "mod.test" }
   519        }
   520        host: (string){ "mod.test" }
   521      }
   522      X: (string){ "mod.test" }
   523    }
   524    builtinCyclePerm4: (struct){
   525      X: (string){ "mod.test" }
   526      Y: (struct){
   527        #components: (#struct){
   528          host: (string){ "mod.test" }
   529        }
   530        host: (string){ "mod.test" }
   531      }
   532    }
   533    builtinCyclePerm5: (struct){
   534      X: (string){ "mod.test" }
   535      Y: (struct){
   536        #components: (#struct){
   537          host: (string){ "mod.test" }
   538        }
   539        host: (string){ "mod.test" }
   540      }
   541    }
   542    issue3634: (struct){
   543      full: (struct){
   544        #Schema: (#struct){
   545          required?: (list){
   546          }
   547          properties?: (#struct){
   548          }
   549        }
   550        out: (int){ 3 }
   551      }
   552      reduced: (struct){
   553        #D: (#struct){
   554          b?: (int){ int }
   555          a?: (_|_){
   556            // [structural cycle] issue3634.reduced.#D.a: structural cycle
   557          }
   558        }
   559        out: (int){ 1 }
   560      }
   561    }
   562    jsonCycle: (_|_){
   563      // [structural cycle]
   564      t1: (_|_){
   565        // [structural cycle]
   566        x: (_|_){
   567          // [structural cycle]
   568          y: (_|_){
   569            // [structural cycle] jsonCycle.t1.x.y: invalid value "{}" (does not satisfy encoding/json.Validate): error in call to encoding/json.Validate: structural cycle:
   570            //     ./jsoncycle.cue:4:8
   571            //     ./jsoncycle.cue:5:8
   572          }
   573        }
   574      }
   575    }
   576    listMatchN: (_|_){
   577      // [eval]
   578      structCycle: (_|_){
   579        // [eval]
   580        x: (_|_){
   581          // [eval]
   582          y: (_|_){
   583            // [eval] listMatchN.structCycle.x.y: invalid value [{}] (does not satisfy list.MatchN): number of matched elements is 0: does not satisfy 1:
   584            //     ./listmatchncycle.cue:4:8
   585            //     ./listmatchncycle.cue:4:20
   586            //     ./listmatchncycle.cue:5:8
   587            0: (struct){
   588            }
   589          }
   590        }
   591      }
   592      ok: (struct){
   593        x: (struct){
   594          y?: (list){ list.MatchN(1, listMatchN.ok.x) }
   595        }
   596        z: (struct){
   597          y: (#list){
   598            0: (struct){
   599            }
   600          }
   601        }
   602      }
   603    }
   604    issue3410: (struct){
   605      _s: (struct){
   606        #x: (_){ matchN(1, (#list){
   607            0: (_|_){// 〈2;_s〉
   608            }
   609            1: (_|_){// [
   610              //   ...〈3;_s〉,
   611              // ]
   612            }
   613          }) }
   614      }
   615      #x: (_){ matchN(1, (#list){
   616          0: (_|_){// 〈2;_s〉
   617          }
   618          1: (_|_){// [
   619            //   ...〈3;_s〉,
   620            // ]
   621          }
   622        }) }
   623    }
   624    issue3420: (struct){
   625      matches1: (struct){
   626        #S: (_){ matchN(1, (#list){
   627            0: (_|_){// _
   628            }
   629            1: (_|_){// _|_(explicit error (_|_ literal) in source)
   630            }
   631          }) }
   632        s: (int){ 2 }
   633      }
   634    }
   635    issue3443: (_|_){
   636      // [eval]
   637      matchIf: (_|_){
   638        // [eval]
   639        #S: (_|_){
   640          // [eval] issue3443.matchIf.#S: cannot call non-function matchIf (type struct):
   641          //     ./matchn.cue:16:7
   642        }
   643      }
   644      noCycle: (struct){
   645        #S: (_){ matchN(1, (#list){
   646            0: (_|_){// {
   647              //   n?: (〈2;#S〉 & (int|{}))
   648              // }
   649            }
   650          }) }
   651        noHang: (struct){
   652          s: (#struct){
   653            n: (struct){
   654              n: (_){ _ }
   655            }
   656          }
   657        }
   658      }
   659      noCycle2: (struct){
   660        #S: (_){ matchN(1, (#list){
   661            0: (_|_){// {
   662              //   n?: (int|〈2;#S〉)
   663              // }
   664            }
   665          }) }
   666      }
   667      cycle1: (_|_){
   668        // [eval]
   669        #S: (_){ matchN(1, (#list){
   670            0: (_|_){// {
   671              //   n: 〈2;#S〉
   672              // }
   673            }
   674          }) }
   675        ok: (struct){
   676          s: (_){ matchN(1, (#list){
   677              0: (_|_){// {
   678                //   n: 〈2;#S〉
   679                // }
   680              }
   681            }) }
   682        }
   683        cycle: (_|_){
   684          // [eval]
   685          s: (_|_){
   686            // [eval] issue3443.cycle1.cycle.s: invalid value {n:{n:_}} (does not satisfy matchN): 0 matched, expected 1:
   687            //     ./matchn.cue:35:7
   688            //     ./matchn.cue:35:14
   689            //     ./matchn.cue:47:7
   690            //     ./matchn.cue:48:7
   691            // issue3443.cycle1.cycle.s.n: invalid value {n:_} (does not satisfy matchN): 0 matched, expected 1:
   692            //     ./matchn.cue:35:7
   693            //     ./matchn.cue:35:14
   694            //     ./matchn.cue:35:22
   695            //     ./matchn.cue:48:10
   696            // issue3443.cycle1.cycle.s.n.n: structural cycle:
   697            //     ./matchn.cue:35:7
   698            n: (struct){
   699              n: (_){ _ }
   700            }
   701          }
   702        }
   703      }
   704      cycle2: (_|_){
   705        // [eval]
   706        fail: (_|_){
   707          // [eval]
   708          #S: (_|_){
   709            // [eval] issue3443.cycle2.fail.#S: invalid value {n:{n:{n:_}}} (does not satisfy matchN): 0 matched, expected 1:
   710            //     ./matchn.cue:55:13
   711            //     ./matchn.cue:55:20
   712            // issue3443.cycle2.fail.#S.n: invalid value {n:{n:{n:_}}} (does not satisfy matchN): 0 matched, expected 1:
   713            //     ./matchn.cue:55:13
   714            //     ./matchn.cue:55:20
   715            //     ./matchn.cue:55:28
   716            //     ./matchn.cue:55:40
   717            // issue3443.cycle2.fail.#S.n.n: invalid value {n:{n:{n:_}}} (does not satisfy matchN): 0 matched, expected 1:
   718            //     ./matchn.cue:55:13
   719            //     ./matchn.cue:55:20
   720            //     ./matchn.cue:55:28
   721            //     ./matchn.cue:55:40
   722            //     ./matchn.cue:55:43
   723            // issue3443.cycle2.fail.#S.n.n.n: structural cycle:
   724            //     ./matchn.cue:55:13
   725            n: (#struct){
   726              n: (#struct){
   727                n: (_){ _ }
   728              }
   729            }
   730          }
   731        }
   732      }
   733    }
   734    issue3633: (struct){
   735      final: (struct){
   736        data: (_|_){
   737          // [incomplete] issue3633.final.data: invalid value {} (does not satisfy matchN): 0 matched, expected 1:
   738          //     ./matchn.cue:63:6
   739          //     ./matchn.cue:62:8
   740          //     ./matchn.cue:63:13
   741          // issue3633.final.data: invalid value {} (does not satisfy matchN): 0 matched, expected 1:
   742          //     ./matchn.cue:63:17
   743          //     ./matchn.cue:62:8
   744          //     ./matchn.cue:63:24
   745          // issue3633.final.data.a: field is required but not present:
   746          //     ./matchn.cue:63:17
   747          //     ./matchn.cue:63:29
   748        }
   749        #s: (_){ matchN(1, (#list){
   750            0: (_|_){// matchN(1, [
   751              //   {
   752              //     a!: _
   753              //   },
   754              // ])
   755            }
   756          }) }
   757      }
   758    }
   759    yamlNoCycle: (struct){
   760      #c: (#struct){
   761        b?: (string){ string }
   762        a?: ((string|bytes)){ "encoding/yaml".Validate(yamlNoCycle.#c) }
   763      }
   764      data: (#struct){
   765        a: (string){ "{a: \"b: foo\"}" }
   766        b?: (string){ string }
   767      }
   768    }
   769    selfCycle: (_|_){
   770      // [eval]
   771      t1: (_|_){
   772        // [eval]
   773        c: (_|_){
   774          // [eval] selfCycle.t1.c: invalid value {d:{}} (does not satisfy matchN): 0 matched, expected 1:
   775          //     ./yamlcycle.cue:14:5
   776          //     ./yamlcycle.cue:14:12
   777          //     ./yamlcycle.cue:15:5
   778          // selfCycle.t1.c.d: invalid value {d:{}} (does not satisfy matchN): 0 matched, expected 1:
   779          //     ./yamlcycle.cue:14:5
   780          //     ./yamlcycle.cue:14:12
   781          //     ./yamlcycle.cue:14:20
   782          //     ./yamlcycle.cue:15:8
   783          // selfCycle.t1.c.d.d: invalid value {d:{}} (does not satisfy matchN): 0 matched, expected 1:
   784          //     ./yamlcycle.cue:14:5
   785          //     ./yamlcycle.cue:14:12
   786          //     ./yamlcycle.cue:14:20
   787          //     ./yamlcycle.cue:15:8
   788          // selfCycle.t1.c.d.d.d: structural cycle:
   789          //     ./yamlcycle.cue:14:5
   790          d: (struct){
   791          }
   792        }
   793      }
   794      t2: (struct){
   795        c: (struct){
   796        }
   797      }
   798      yamlVal: (_|_){
   799        // [eval]
   800        t1: (_|_){
   801          // [eval]
   802          x: (_|_){
   803            // [eval]
   804            y: (_|_){
   805              // [eval] selfCycle.yamlVal.t1.x.y: invalid value "{}" (does not satisfy encoding/yaml.Validate): error in call to encoding/yaml.Validate: structural cycle:
   806              //     ./yamlcycle.cue:24:8
   807              //     ./yamlcycle.cue:25:8
   808            }
   809          }
   810        }
   811        t2: (_|_){
   812          // [eval]
   813          x: (_|_){
   814            // [eval]
   815            y: (_|_){
   816              // [eval] selfCycle.yamlVal.t2.x.y: invalid value "{}" (does not satisfy encoding/yaml.Validate): error in call to encoding/yaml.Validate: structural cycle:
   817              //     ./yamlcycle.cue:30:8
   818              //     ./yamlcycle.cue:31:8
   819              //     ./yamlcycle.cue:32:8
   820              //     ./yamlcycle.cue:33:8
   821            }
   822          }
   823        }
   824      }
   825      yamlFun: (_|_){
   826        // [eval]
   827        t1: (struct){
   828          x: (struct){
   829            y?: (bool){ true }
   830          }
   831        }
   832        t2: (_|_){
   833          // [eval]
   834          z: (_|_){
   835            // [eval]
   836            y: (_|_){
   837              // [eval] selfCycle.yamlFun.t2.z.y: error in call to encoding/yaml.Validate: structural cycle:
   838              //     ./yamlcycle.cue:41:8
   839            }
   840          }
   841          x: (_|_){
   842            // [eval]
   843            y: (_|_){
   844              // [eval] selfCycle.yamlFun.t2.x.y: error in call to encoding/yaml.Validate: structural cycle:
   845              //     ./yamlcycle.cue:41:8
   846            }
   847          }
   848        }
   849      }
   850      yamlValidatePartial: (_|_){
   851        // [structural cycle]
   852        x: (_|_){
   853          // [structural cycle]
   854          y: (_|_){
   855            // [structural cycle] selfCycle.yamlValidatePartial.x.y: invalid value "{}" (does not satisfy encoding/yaml.ValidatePartial): error in call to encoding/yaml.ValidatePartial: structural cycle:
   856            //     ./yamlcycle.cue:44:8
   857            //     ./yamlcycle.cue:45:8
   858          }
   859        }
   860      }
   861    }
   862  }
   863  -- diff/-out/evalalpha<==>+out/eval --
   864  diff old new
   865  --- old
   866  +++ new
   867  @@ -3,24 +3,39 @@
   868       ./cycle.cue:4:7
   869       ./cycle.cue:4:14
   870       ./cycle.cue:5:13
   871  -noCycle.t1.#x.#x: invalid value {} (does not satisfy matchN): 0 matched, expected 1:
   872  -    ./cycle.cue:4:7
   873  -    ./cycle.cue:4:14
   874  -    ./cycle.cue:5:13
   875  +noCycle.t1.#x.#x: structural cycle:
   876  +    ./cycle.cue:4:7
   877   noCycle.t1._s.#x: invalid value {} (does not satisfy matchN): 0 matched, expected 1:
   878       ./cycle.cue:4:7
   879       ./cycle.cue:4:14
   880       ./cycle.cue:5:13
   881  -noCycle.t1._s.#x.#x: invalid value {} (does not satisfy matchN): 0 matched, expected 1:
   882  -    ./cycle.cue:4:7
   883  -    ./cycle.cue:4:14
   884  -    ./cycle.cue:5:13
   885  -jsonCycle.t1.x.y.y: structural cycle:
   886  -    ./jsoncycle.cue:4:22
   887  -listMatchN.structCycle.x.y.y: structural cycle:
   888  -    ./listmatchncycle.cue:4:23
   889  +issue3649.cycle.t1.data.a: invalid value {b:"foo"} (does not satisfy matchN): 0 matched, expected 1:
   890  +    ./cycle.cue:31:6
   891  +    ./cycle.cue:28:11
   892  +    ./cycle.cue:31:13
   893  +issue3649.cycle.t1.data.a.a: structural cycle:
   894  +    ./cycle.cue:31:6
   895  +jsonCycle.t1.x.y: invalid value "{}" (does not satisfy encoding/json.Validate): error in call to encoding/json.Validate: structural cycle:
   896  +    ./jsoncycle.cue:4:8
   897  +    ./jsoncycle.cue:5:8
   898  +listMatchN.structCycle.x.y: invalid value [{}] (does not satisfy list.MatchN): number of matched elements is 0: does not satisfy 1:
   899  +    ./listmatchncycle.cue:4:8
   900  +    ./listmatchncycle.cue:4:20
   901  +    ./listmatchncycle.cue:5:8
   902   issue3443.matchIf.#S: cannot call non-function matchIf (type struct):
   903       ./matchn.cue:16:7
   904  +issue3443.cycle1.cycle.s: invalid value {n:{n:_}} (does not satisfy matchN): 0 matched, expected 1:
   905  +    ./matchn.cue:35:7
   906  +    ./matchn.cue:35:14
   907  +    ./matchn.cue:47:7
   908  +    ./matchn.cue:48:7
   909  +issue3443.cycle1.cycle.s.n: invalid value {n:_} (does not satisfy matchN): 0 matched, expected 1:
   910  +    ./matchn.cue:35:7
   911  +    ./matchn.cue:35:14
   912  +    ./matchn.cue:35:22
   913  +    ./matchn.cue:48:10
   914  +issue3443.cycle1.cycle.s.n.n: structural cycle:
   915  +    ./matchn.cue:35:7
   916   issue3443.cycle2.fail.#S: invalid value {n:{n:{n:_}}} (does not satisfy matchN): 0 matched, expected 1:
   917       ./matchn.cue:55:13
   918       ./matchn.cue:55:20
   919  @@ -53,26 +68,21 @@
   920       ./yamlcycle.cue:15:8
   921   selfCycle.t1.c.d.d.d: structural cycle:
   922       ./yamlcycle.cue:14:5
   923  -selfCycle.t2.c: invalid value {} (does not satisfy matchN): 0 matched, expected 1:
   924  -    ./yamlcycle.cue:20:5
   925  -    ./yamlcycle.cue:20:12
   926  -    ./yamlcycle.cue:21:5
   927  -selfCycle.t2.c.d: invalid value {} (does not satisfy matchN): 0 matched, expected 1:
   928  -    ./yamlcycle.cue:20:5
   929  -    ./yamlcycle.cue:20:12
   930  -    ./yamlcycle.cue:20:20
   931  -selfCycle.t2.c.d.d: structural cycle:
   932  -    ./yamlcycle.cue:20:5
   933  -selfCycle.yamlVal.t1.x.y.y: structural cycle:
   934  -    ./yamlcycle.cue:24:22
   935  -selfCycle.yamlVal.t2.x.y.y: structural cycle:
   936  -    ./yamlcycle.cue:32:22
   937  -selfCycle.yamlFun.t1.x.y.y: structural cycle:
   938  -    ./yamlcycle.cue:36:29
   939  -selfCycle.yamlFun.t2.x.y.y: structural cycle:
   940  -    ./yamlcycle.cue:41:28
   941  -selfCycle.yamlValidatePartial.x.y.y: structural cycle:
   942  -    ./yamlcycle.cue:44:29
   943  +selfCycle.yamlVal.t1.x.y: invalid value "{}" (does not satisfy encoding/yaml.Validate): error in call to encoding/yaml.Validate: structural cycle:
   944  +    ./yamlcycle.cue:24:8
   945  +    ./yamlcycle.cue:25:8
   946  +selfCycle.yamlVal.t2.x.y: invalid value "{}" (does not satisfy encoding/yaml.Validate): error in call to encoding/yaml.Validate: structural cycle:
   947  +    ./yamlcycle.cue:30:8
   948  +    ./yamlcycle.cue:31:8
   949  +    ./yamlcycle.cue:32:8
   950  +    ./yamlcycle.cue:33:8
   951  +selfCycle.yamlFun.t2.x.y: error in call to encoding/yaml.Validate: structural cycle:
   952  +    ./yamlcycle.cue:41:8
   953  +selfCycle.yamlFun.t2.z.y: error in call to encoding/yaml.Validate: structural cycle:
   954  +    ./yamlcycle.cue:41:8
   955  +selfCycle.yamlValidatePartial.x.y: invalid value "{}" (does not satisfy encoding/yaml.ValidatePartial): error in call to encoding/yaml.ValidatePartial: structural cycle:
   956  +    ./yamlcycle.cue:44:8
   957  +    ./yamlcycle.cue:45:8
   958   
   959   Result:
   960   (_|_){
   961  @@ -88,10 +98,6 @@
   962             //     ./cycle.cue:4:7
   963             //     ./cycle.cue:4:14
   964             //     ./cycle.cue:5:13
   965  -          // noCycle.t1._s.#x.#x: invalid value {} (does not satisfy matchN): 0 matched, expected 1:
   966  -          //     ./cycle.cue:4:7
   967  -          //     ./cycle.cue:4:14
   968  -          //     ./cycle.cue:5:13
   969           }
   970         }
   971         #x: (_|_){
   972  @@ -99,21 +105,20 @@
   973           //     ./cycle.cue:4:7
   974           //     ./cycle.cue:4:14
   975           //     ./cycle.cue:5:13
   976  -        // noCycle.t1.#x.#x: invalid value {} (does not satisfy matchN): 0 matched, expected 1:
   977  -        //     ./cycle.cue:4:7
   978  -        //     ./cycle.cue:4:14
   979  -        //     ./cycle.cue:5:13
   980  -      }
   981  -    }
   982  -  }
   983  -  issue3649: (struct){
   984  -    noCycle: (struct){
   985  -      t1: (struct){
   986  -        data: (#struct){
   987  -          b?: (string){ string }
   988  -          a: (struct){
   989  -            b: (string){ "foo" }
   990  -          }
   991  +        // noCycle.t1.#x.#x: structural cycle:
   992  +        //     ./cycle.cue:4:7
   993  +      }
   994  +    }
   995  +  }
   996  +  issue3649: (_|_){
   997  +    // [eval]
   998  +    noCycle: (struct){
   999  +      t1: (struct){
  1000  +        data: (#struct){
  1001  +          a: (#struct){
  1002  +            b: (string){ "foo" }
  1003  +          }
  1004  +          b?: (string){ string }
  1005           }
  1006           #c: (#struct){
  1007             b?: (string){ string }
  1008  @@ -125,7 +130,6 @@
  1009         }
  1010         t2: (struct){
  1011           x: (struct){
  1012  -          b?: (string){ string }
  1013             y: (struct){
  1014               a: (struct){
  1015                 d: (struct){
  1016  @@ -133,6 +137,7 @@
  1017                 }
  1018               }
  1019             }
  1020  +          b?: (string){ string }
  1021           }
  1022           c: (struct){
  1023             b?: (string){ string }
  1024  @@ -147,13 +152,22 @@
  1025           }
  1026         }
  1027       }
  1028  -    cycle: (struct){
  1029  -      t1: (struct){
  1030  -        data: (#struct){
  1031  -          b: (string){ string }
  1032  -          a: (struct){
  1033  -            b: (string){ "foo" }
  1034  -          }
  1035  +    cycle: (_|_){
  1036  +      // [eval]
  1037  +      t1: (_|_){
  1038  +        // [eval]
  1039  +        data: (_|_){
  1040  +          // [eval]
  1041  +          a: (_|_){
  1042  +            // [eval] issue3649.cycle.t1.data.a: invalid value {b:"foo"} (does not satisfy matchN): 0 matched, expected 1:
  1043  +            //     ./cycle.cue:31:6
  1044  +            //     ./cycle.cue:28:11
  1045  +            //     ./cycle.cue:31:13
  1046  +            // issue3649.cycle.t1.data.a.a: structural cycle:
  1047  +            //     ./cycle.cue:31:6
  1048  +            b: (string){ "foo" }
  1049  +          }
  1050  +          b: (string){ string }
  1051           }
  1052           #c: (#struct){
  1053             b: (string){ string }
  1054  @@ -244,8 +258,12 @@
  1055       t1: (_|_){
  1056         // [structural cycle]
  1057         x: (_|_){
  1058  -        // [structural cycle] jsonCycle.t1.x.y.y: structural cycle:
  1059  -        //     ./jsoncycle.cue:4:22
  1060  +        // [structural cycle]
  1061  +        y: (_|_){
  1062  +          // [structural cycle] jsonCycle.t1.x.y: invalid value "{}" (does not satisfy encoding/json.Validate): error in call to encoding/json.Validate: structural cycle:
  1063  +          //     ./jsoncycle.cue:4:8
  1064  +          //     ./jsoncycle.cue:5:8
  1065  +        }
  1066         }
  1067       }
  1068     }
  1069  @@ -254,8 +272,15 @@
  1070       structCycle: (_|_){
  1071         // [eval]
  1072         x: (_|_){
  1073  -        // [eval] listMatchN.structCycle.x.y.y: structural cycle:
  1074  -        //     ./listmatchncycle.cue:4:23
  1075  +        // [eval]
  1076  +        y: (_|_){
  1077  +          // [eval] listMatchN.structCycle.x.y: invalid value [{}] (does not satisfy list.MatchN): number of matched elements is 0: does not satisfy 1:
  1078  +          //     ./listmatchncycle.cue:4:8
  1079  +          //     ./listmatchncycle.cue:4:20
  1080  +          //     ./listmatchncycle.cue:5:8
  1081  +          0: (struct){
  1082  +          }
  1083  +        }
  1084         }
  1085       }
  1086       ok: (struct){
  1087  @@ -318,7 +343,7 @@
  1088             }
  1089           }) }
  1090         noHang: (struct){
  1091  -        s: (struct){
  1092  +        s: (#struct){
  1093             n: (struct){
  1094               n: (_){ _ }
  1095             }
  1096  @@ -333,7 +358,8 @@
  1097             }
  1098           }) }
  1099       }
  1100  -    cycle1: (struct){
  1101  +    cycle1: (_|_){
  1102  +      // [eval]
  1103         #S: (_){ matchN(1, (#list){
  1104             0: (_|_){// {
  1105               //   n: 〈2;#S〉
  1106  @@ -348,8 +374,21 @@
  1107               }
  1108             }) }
  1109         }
  1110  -      cycle: (struct){
  1111  -        s: (struct){
  1112  +      cycle: (_|_){
  1113  +        // [eval]
  1114  +        s: (_|_){
  1115  +          // [eval] issue3443.cycle1.cycle.s: invalid value {n:{n:_}} (does not satisfy matchN): 0 matched, expected 1:
  1116  +          //     ./matchn.cue:35:7
  1117  +          //     ./matchn.cue:35:14
  1118  +          //     ./matchn.cue:47:7
  1119  +          //     ./matchn.cue:48:7
  1120  +          // issue3443.cycle1.cycle.s.n: invalid value {n:_} (does not satisfy matchN): 0 matched, expected 1:
  1121  +          //     ./matchn.cue:35:7
  1122  +          //     ./matchn.cue:35:14
  1123  +          //     ./matchn.cue:35:22
  1124  +          //     ./matchn.cue:48:10
  1125  +          // issue3443.cycle1.cycle.s.n.n: structural cycle:
  1126  +          //     ./matchn.cue:35:7
  1127             n: (struct){
  1128               n: (_){ _ }
  1129             }
  1130  @@ -393,13 +432,13 @@
  1131           //     ./matchn.cue:63:6
  1132           //     ./matchn.cue:62:8
  1133           //     ./matchn.cue:63:13
  1134  -        // issue3633.final.a: field is required but not present:
  1135  -        //     ./matchn.cue:63:17
  1136  -        //     ./matchn.cue:63:29
  1137           // issue3633.final.data: invalid value {} (does not satisfy matchN): 0 matched, expected 1:
  1138           //     ./matchn.cue:63:17
  1139           //     ./matchn.cue:62:8
  1140           //     ./matchn.cue:63:24
  1141  +        // issue3633.final.data.a: field is required but not present:
  1142  +        //     ./matchn.cue:63:17
  1143  +        //     ./matchn.cue:63:29
  1144         }
  1145         #s: (_){ matchN(1, (#list){
  1146             0: (_|_){// matchN(1, [
  1147  @@ -417,8 +456,8 @@
  1148         a?: ((string|bytes)){ "encoding/yaml".Validate(yamlNoCycle.#c) }
  1149       }
  1150       data: (#struct){
  1151  -      b?: (string){ string }
  1152         a: (string){ "{a: \"b: foo\"}" }
  1153  +      b?: (string){ string }
  1154       }
  1155     }
  1156     selfCycle: (_|_){
  1157  @@ -446,19 +485,8 @@
  1158           }
  1159         }
  1160       }
  1161  -    t2: (_|_){
  1162  -      // [eval]
  1163  -      c: (_|_){
  1164  -        // [eval] selfCycle.t2.c: invalid value {} (does not satisfy matchN): 0 matched, expected 1:
  1165  -        //     ./yamlcycle.cue:20:5
  1166  -        //     ./yamlcycle.cue:20:12
  1167  -        //     ./yamlcycle.cue:21:5
  1168  -        // selfCycle.t2.c.d: invalid value {} (does not satisfy matchN): 0 matched, expected 1:
  1169  -        //     ./yamlcycle.cue:20:5
  1170  -        //     ./yamlcycle.cue:20:12
  1171  -        //     ./yamlcycle.cue:20:20
  1172  -        // selfCycle.t2.c.d.d: structural cycle:
  1173  -        //     ./yamlcycle.cue:20:5
  1174  +    t2: (struct){
  1175  +      c: (struct){
  1176         }
  1177       }
  1178       yamlVal: (_|_){
  1179  @@ -466,25 +494,33 @@
  1180         t1: (_|_){
  1181           // [eval]
  1182           x: (_|_){
  1183  -          // [eval] selfCycle.yamlVal.t1.x.y.y: structural cycle:
  1184  -          //     ./yamlcycle.cue:24:22
  1185  -        }
  1186  -      }
  1187  -      t2: (_|_){
  1188  -        // [eval]
  1189  -        x: (_|_){
  1190  -          // [eval] selfCycle.yamlVal.t2.x.y.y: structural cycle:
  1191  -          //     ./yamlcycle.cue:32:22
  1192  +          // [eval]
  1193  +          y: (_|_){
  1194  +            // [eval] selfCycle.yamlVal.t1.x.y: invalid value "{}" (does not satisfy encoding/yaml.Validate): error in call to encoding/yaml.Validate: structural cycle:
  1195  +            //     ./yamlcycle.cue:24:8
  1196  +            //     ./yamlcycle.cue:25:8
  1197  +          }
  1198  +        }
  1199  +      }
  1200  +      t2: (_|_){
  1201  +        // [eval]
  1202  +        x: (_|_){
  1203  +          // [eval]
  1204  +          y: (_|_){
  1205  +            // [eval] selfCycle.yamlVal.t2.x.y: invalid value "{}" (does not satisfy encoding/yaml.Validate): error in call to encoding/yaml.Validate: structural cycle:
  1206  +            //     ./yamlcycle.cue:30:8
  1207  +            //     ./yamlcycle.cue:31:8
  1208  +            //     ./yamlcycle.cue:32:8
  1209  +            //     ./yamlcycle.cue:33:8
  1210  +          }
  1211           }
  1212         }
  1213       }
  1214       yamlFun: (_|_){
  1215         // [eval]
  1216  -      t1: (_|_){
  1217  -        // [structural cycle]
  1218  -        x: (_|_){
  1219  -          // [structural cycle] selfCycle.yamlFun.t1.x.y.y: structural cycle:
  1220  -          //     ./yamlcycle.cue:36:29
  1221  +      t1: (struct){
  1222  +        x: (struct){
  1223  +          y?: (bool){ true }
  1224           }
  1225         }
  1226         t2: (_|_){
  1227  @@ -492,13 +528,16 @@
  1228           z: (_|_){
  1229             // [eval]
  1230             y: (_|_){
  1231  -            // [eval] selfCycle.yamlFun.t2.x.y.y: structural cycle:
  1232  -            //     ./yamlcycle.cue:41:28
  1233  -          }
  1234  -        }
  1235  -        x: (_|_){
  1236  -          // [eval] selfCycle.yamlFun.t2.x.y.y: structural cycle:
  1237  -          //     ./yamlcycle.cue:41:28
  1238  +            // [eval] selfCycle.yamlFun.t2.z.y: error in call to encoding/yaml.Validate: structural cycle:
  1239  +            //     ./yamlcycle.cue:41:8
  1240  +          }
  1241  +        }
  1242  +        x: (_|_){
  1243  +          // [eval]
  1244  +          y: (_|_){
  1245  +            // [eval] selfCycle.yamlFun.t2.x.y: error in call to encoding/yaml.Validate: structural cycle:
  1246  +            //     ./yamlcycle.cue:41:8
  1247  +          }
  1248           }
  1249         }
  1250       }
  1251  @@ -505,8 +544,12 @@
  1252       yamlValidatePartial: (_|_){
  1253         // [structural cycle]
  1254         x: (_|_){
  1255  -        // [structural cycle] selfCycle.yamlValidatePartial.x.y.y: structural cycle:
  1256  -        //     ./yamlcycle.cue:44:29
  1257  +        // [structural cycle]
  1258  +        y: (_|_){
  1259  +          // [structural cycle] selfCycle.yamlValidatePartial.x.y: invalid value "{}" (does not satisfy encoding/yaml.ValidatePartial): error in call to encoding/yaml.ValidatePartial: structural cycle:
  1260  +          //     ./yamlcycle.cue:44:8
  1261  +          //     ./yamlcycle.cue:45:8
  1262  +        }
  1263         }
  1264       }
  1265     }
  1266  -- diff/todo/p2 --
  1267  issue3443: Sort out differences in reporting of cycles.
  1268  -- out/eval --
  1269  Errors:
  1270  noCycle.t1.#x: invalid value {} (does not satisfy matchN): 0 matched, expected 1:
  1271      ./cycle.cue:4:7
  1272      ./cycle.cue:4:14
  1273      ./cycle.cue:5:13
  1274  noCycle.t1.#x.#x: invalid value {} (does not satisfy matchN): 0 matched, expected 1:
  1275      ./cycle.cue:4:7
  1276      ./cycle.cue:4:14
  1277      ./cycle.cue:5:13
  1278  noCycle.t1._s.#x: invalid value {} (does not satisfy matchN): 0 matched, expected 1:
  1279      ./cycle.cue:4:7
  1280      ./cycle.cue:4:14
  1281      ./cycle.cue:5:13
  1282  noCycle.t1._s.#x.#x: invalid value {} (does not satisfy matchN): 0 matched, expected 1:
  1283      ./cycle.cue:4:7
  1284      ./cycle.cue:4:14
  1285      ./cycle.cue:5:13
  1286  jsonCycle.t1.x.y.y: structural cycle:
  1287      ./jsoncycle.cue:4:22
  1288  listMatchN.structCycle.x.y.y: structural cycle:
  1289      ./listmatchncycle.cue:4:23
  1290  issue3443.matchIf.#S: cannot call non-function matchIf (type struct):
  1291      ./matchn.cue:16:7
  1292  issue3443.cycle2.fail.#S: invalid value {n:{n:{n:_}}} (does not satisfy matchN): 0 matched, expected 1:
  1293      ./matchn.cue:55:13
  1294      ./matchn.cue:55:20
  1295  issue3443.cycle2.fail.#S.n: invalid value {n:{n:{n:_}}} (does not satisfy matchN): 0 matched, expected 1:
  1296      ./matchn.cue:55:13
  1297      ./matchn.cue:55:20
  1298      ./matchn.cue:55:28
  1299      ./matchn.cue:55:40
  1300  issue3443.cycle2.fail.#S.n.n: invalid value {n:{n:{n:_}}} (does not satisfy matchN): 0 matched, expected 1:
  1301      ./matchn.cue:55:13
  1302      ./matchn.cue:55:20
  1303      ./matchn.cue:55:28
  1304      ./matchn.cue:55:40
  1305      ./matchn.cue:55:43
  1306  issue3443.cycle2.fail.#S.n.n.n: structural cycle:
  1307      ./matchn.cue:55:13
  1308  selfCycle.t1.c: invalid value {d:{}} (does not satisfy matchN): 0 matched, expected 1:
  1309      ./yamlcycle.cue:14:5
  1310      ./yamlcycle.cue:14:12
  1311      ./yamlcycle.cue:15:5
  1312  selfCycle.t1.c.d: invalid value {d:{}} (does not satisfy matchN): 0 matched, expected 1:
  1313      ./yamlcycle.cue:14:5
  1314      ./yamlcycle.cue:14:12
  1315      ./yamlcycle.cue:14:20
  1316      ./yamlcycle.cue:15:8
  1317  selfCycle.t1.c.d.d: invalid value {d:{}} (does not satisfy matchN): 0 matched, expected 1:
  1318      ./yamlcycle.cue:14:5
  1319      ./yamlcycle.cue:14:12
  1320      ./yamlcycle.cue:14:20
  1321      ./yamlcycle.cue:15:8
  1322  selfCycle.t1.c.d.d.d: structural cycle:
  1323      ./yamlcycle.cue:14:5
  1324  selfCycle.t2.c: invalid value {} (does not satisfy matchN): 0 matched, expected 1:
  1325      ./yamlcycle.cue:20:5
  1326      ./yamlcycle.cue:20:12
  1327      ./yamlcycle.cue:21:5
  1328  selfCycle.t2.c.d: invalid value {} (does not satisfy matchN): 0 matched, expected 1:
  1329      ./yamlcycle.cue:20:5
  1330      ./yamlcycle.cue:20:12
  1331      ./yamlcycle.cue:20:20
  1332  selfCycle.t2.c.d.d: structural cycle:
  1333      ./yamlcycle.cue:20:5
  1334  selfCycle.yamlVal.t1.x.y.y: structural cycle:
  1335      ./yamlcycle.cue:24:22
  1336  selfCycle.yamlVal.t2.x.y.y: structural cycle:
  1337      ./yamlcycle.cue:32:22
  1338  selfCycle.yamlFun.t1.x.y.y: structural cycle:
  1339      ./yamlcycle.cue:36:29
  1340  selfCycle.yamlFun.t2.x.y.y: structural cycle:
  1341      ./yamlcycle.cue:41:28
  1342  selfCycle.yamlValidatePartial.x.y.y: structural cycle:
  1343      ./yamlcycle.cue:44:29
  1344  
  1345  Result:
  1346  (_|_){
  1347    // [eval]
  1348    noCycle: (_|_){
  1349      // [eval]
  1350      t1: (_|_){
  1351        // [eval]
  1352        _s: (_|_){
  1353          // [eval]
  1354          #x: (_|_){
  1355            // [eval] noCycle.t1._s.#x: invalid value {} (does not satisfy matchN): 0 matched, expected 1:
  1356            //     ./cycle.cue:4:7
  1357            //     ./cycle.cue:4:14
  1358            //     ./cycle.cue:5:13
  1359            // noCycle.t1._s.#x.#x: invalid value {} (does not satisfy matchN): 0 matched, expected 1:
  1360            //     ./cycle.cue:4:7
  1361            //     ./cycle.cue:4:14
  1362            //     ./cycle.cue:5:13
  1363          }
  1364        }
  1365        #x: (_|_){
  1366          // [eval] noCycle.t1.#x: invalid value {} (does not satisfy matchN): 0 matched, expected 1:
  1367          //     ./cycle.cue:4:7
  1368          //     ./cycle.cue:4:14
  1369          //     ./cycle.cue:5:13
  1370          // noCycle.t1.#x.#x: invalid value {} (does not satisfy matchN): 0 matched, expected 1:
  1371          //     ./cycle.cue:4:7
  1372          //     ./cycle.cue:4:14
  1373          //     ./cycle.cue:5:13
  1374        }
  1375      }
  1376    }
  1377    issue3649: (struct){
  1378      noCycle: (struct){
  1379        t1: (struct){
  1380          data: (#struct){
  1381            b?: (string){ string }
  1382            a: (struct){
  1383              b: (string){ "foo" }
  1384            }
  1385          }
  1386          #c: (#struct){
  1387            b?: (string){ string }
  1388            a?: (_){ matchN(1, (#list){
  1389                0: (_|_){// 〈2;#c〉
  1390                }
  1391              }) }
  1392          }
  1393        }
  1394        t2: (struct){
  1395          x: (struct){
  1396            b?: (string){ string }
  1397            y: (struct){
  1398              a: (struct){
  1399                d: (struct){
  1400                  b: (string){ "foo" }
  1401                }
  1402              }
  1403            }
  1404          }
  1405          c: (struct){
  1406            b?: (string){ string }
  1407            y: (struct){
  1408              a?: (_){ matchN(1, (#list){
  1409                  0: (_|_){// {
  1410                    //   d: 〈4;c〉
  1411                    // }
  1412                  }
  1413                }) }
  1414            }
  1415          }
  1416        }
  1417      }
  1418      cycle: (struct){
  1419        t1: (struct){
  1420          data: (#struct){
  1421            b: (string){ string }
  1422            a: (struct){
  1423              b: (string){ "foo" }
  1424            }
  1425          }
  1426          #c: (#struct){
  1427            b: (string){ string }
  1428            a: (_){ matchN(1, (#list){
  1429                0: (_|_){// 〈2;#c〉
  1430                }
  1431              }) }
  1432          }
  1433        }
  1434      }
  1435    }
  1436    builtinCyclePerm0: (struct){
  1437      X: (string){ "mod.test" }
  1438      Y: (struct){
  1439        #components: (#struct){
  1440          host: (string){ "mod.test" }
  1441        }
  1442        host: (string){ "mod.test" }
  1443      }
  1444    }
  1445    builtinCyclePerm1: (struct){
  1446      X: (string){ "mod.test" }
  1447      Y: (struct){
  1448        #components: (#struct){
  1449          host: (string){ "mod.test" }
  1450        }
  1451        host: (string){ "mod.test" }
  1452      }
  1453    }
  1454    builtinCyclePerm2: (struct){
  1455      Y: (struct){
  1456        #components: (#struct){
  1457          host: (string){ "mod.test" }
  1458        }
  1459        host: (string){ "mod.test" }
  1460      }
  1461      X: (string){ "mod.test" }
  1462    }
  1463    builtinCyclePerm3: (struct){
  1464      Y: (struct){
  1465        #components: (#struct){
  1466          host: (string){ "mod.test" }
  1467        }
  1468        host: (string){ "mod.test" }
  1469      }
  1470      X: (string){ "mod.test" }
  1471    }
  1472    builtinCyclePerm4: (struct){
  1473      X: (string){ "mod.test" }
  1474      Y: (struct){
  1475        #components: (#struct){
  1476          host: (string){ "mod.test" }
  1477        }
  1478        host: (string){ "mod.test" }
  1479      }
  1480    }
  1481    builtinCyclePerm5: (struct){
  1482      X: (string){ "mod.test" }
  1483      Y: (struct){
  1484        #components: (#struct){
  1485          host: (string){ "mod.test" }
  1486        }
  1487        host: (string){ "mod.test" }
  1488      }
  1489    }
  1490    issue3634: (struct){
  1491      full: (struct){
  1492        #Schema: (#struct){
  1493          required?: (list){
  1494          }
  1495          properties?: (#struct){
  1496          }
  1497        }
  1498        out: (int){ 3 }
  1499      }
  1500      reduced: (struct){
  1501        #D: (#struct){
  1502          b?: (int){ int }
  1503          a?: (_|_){
  1504            // [structural cycle] issue3634.reduced.#D.a: structural cycle
  1505          }
  1506        }
  1507        out: (int){ 1 }
  1508      }
  1509    }
  1510    jsonCycle: (_|_){
  1511      // [structural cycle]
  1512      t1: (_|_){
  1513        // [structural cycle]
  1514        x: (_|_){
  1515          // [structural cycle] jsonCycle.t1.x.y.y: structural cycle:
  1516          //     ./jsoncycle.cue:4:22
  1517        }
  1518      }
  1519    }
  1520    listMatchN: (_|_){
  1521      // [eval]
  1522      structCycle: (_|_){
  1523        // [eval]
  1524        x: (_|_){
  1525          // [eval] listMatchN.structCycle.x.y.y: structural cycle:
  1526          //     ./listmatchncycle.cue:4:23
  1527        }
  1528      }
  1529      ok: (struct){
  1530        x: (struct){
  1531          y?: (list){ list.MatchN(1, listMatchN.ok.x) }
  1532        }
  1533        z: (struct){
  1534          y: (#list){
  1535            0: (struct){
  1536            }
  1537          }
  1538        }
  1539      }
  1540    }
  1541    issue3410: (struct){
  1542      _s: (struct){
  1543        #x: (_){ matchN(1, (#list){
  1544            0: (_|_){// 〈2;_s〉
  1545            }
  1546            1: (_|_){// [
  1547              //   ...〈3;_s〉,
  1548              // ]
  1549            }
  1550          }) }
  1551      }
  1552      #x: (_){ matchN(1, (#list){
  1553          0: (_|_){// 〈2;_s〉
  1554          }
  1555          1: (_|_){// [
  1556            //   ...〈3;_s〉,
  1557            // ]
  1558          }
  1559        }) }
  1560    }
  1561    issue3420: (struct){
  1562      matches1: (struct){
  1563        #S: (_){ matchN(1, (#list){
  1564            0: (_|_){// _
  1565            }
  1566            1: (_|_){// _|_(explicit error (_|_ literal) in source)
  1567            }
  1568          }) }
  1569        s: (int){ 2 }
  1570      }
  1571    }
  1572    issue3443: (_|_){
  1573      // [eval]
  1574      matchIf: (_|_){
  1575        // [eval]
  1576        #S: (_|_){
  1577          // [eval] issue3443.matchIf.#S: cannot call non-function matchIf (type struct):
  1578          //     ./matchn.cue:16:7
  1579        }
  1580      }
  1581      noCycle: (struct){
  1582        #S: (_){ matchN(1, (#list){
  1583            0: (_|_){// {
  1584              //   n?: (〈2;#S〉 & (int|{}))
  1585              // }
  1586            }
  1587          }) }
  1588        noHang: (struct){
  1589          s: (struct){
  1590            n: (struct){
  1591              n: (_){ _ }
  1592            }
  1593          }
  1594        }
  1595      }
  1596      noCycle2: (struct){
  1597        #S: (_){ matchN(1, (#list){
  1598            0: (_|_){// {
  1599              //   n?: (int|〈2;#S〉)
  1600              // }
  1601            }
  1602          }) }
  1603      }
  1604      cycle1: (struct){
  1605        #S: (_){ matchN(1, (#list){
  1606            0: (_|_){// {
  1607              //   n: 〈2;#S〉
  1608              // }
  1609            }
  1610          }) }
  1611        ok: (struct){
  1612          s: (_){ matchN(1, (#list){
  1613              0: (_|_){// {
  1614                //   n: 〈2;#S〉
  1615                // }
  1616              }
  1617            }) }
  1618        }
  1619        cycle: (struct){
  1620          s: (struct){
  1621            n: (struct){
  1622              n: (_){ _ }
  1623            }
  1624          }
  1625        }
  1626      }
  1627      cycle2: (_|_){
  1628        // [eval]
  1629        fail: (_|_){
  1630          // [eval]
  1631          #S: (_|_){
  1632            // [eval] issue3443.cycle2.fail.#S: invalid value {n:{n:{n:_}}} (does not satisfy matchN): 0 matched, expected 1:
  1633            //     ./matchn.cue:55:13
  1634            //     ./matchn.cue:55:20
  1635            // issue3443.cycle2.fail.#S.n: invalid value {n:{n:{n:_}}} (does not satisfy matchN): 0 matched, expected 1:
  1636            //     ./matchn.cue:55:13
  1637            //     ./matchn.cue:55:20
  1638            //     ./matchn.cue:55:28
  1639            //     ./matchn.cue:55:40
  1640            // issue3443.cycle2.fail.#S.n.n: invalid value {n:{n:{n:_}}} (does not satisfy matchN): 0 matched, expected 1:
  1641            //     ./matchn.cue:55:13
  1642            //     ./matchn.cue:55:20
  1643            //     ./matchn.cue:55:28
  1644            //     ./matchn.cue:55:40
  1645            //     ./matchn.cue:55:43
  1646            // issue3443.cycle2.fail.#S.n.n.n: structural cycle:
  1647            //     ./matchn.cue:55:13
  1648            n: (#struct){
  1649              n: (#struct){
  1650                n: (_){ _ }
  1651              }
  1652            }
  1653          }
  1654        }
  1655      }
  1656    }
  1657    issue3633: (struct){
  1658      final: (struct){
  1659        data: (_|_){
  1660          // [incomplete] issue3633.final.data: invalid value {} (does not satisfy matchN): 0 matched, expected 1:
  1661          //     ./matchn.cue:63:6
  1662          //     ./matchn.cue:62:8
  1663          //     ./matchn.cue:63:13
  1664          // issue3633.final.a: field is required but not present:
  1665          //     ./matchn.cue:63:17
  1666          //     ./matchn.cue:63:29
  1667          // issue3633.final.data: invalid value {} (does not satisfy matchN): 0 matched, expected 1:
  1668          //     ./matchn.cue:63:17
  1669          //     ./matchn.cue:62:8
  1670          //     ./matchn.cue:63:24
  1671        }
  1672        #s: (_){ matchN(1, (#list){
  1673            0: (_|_){// matchN(1, [
  1674              //   {
  1675              //     a!: _
  1676              //   },
  1677              // ])
  1678            }
  1679          }) }
  1680      }
  1681    }
  1682    yamlNoCycle: (struct){
  1683      #c: (#struct){
  1684        b?: (string){ string }
  1685        a?: ((string|bytes)){ "encoding/yaml".Validate(yamlNoCycle.#c) }
  1686      }
  1687      data: (#struct){
  1688        b?: (string){ string }
  1689        a: (string){ "{a: \"b: foo\"}" }
  1690      }
  1691    }
  1692    selfCycle: (_|_){
  1693      // [eval]
  1694      t1: (_|_){
  1695        // [eval]
  1696        c: (_|_){
  1697          // [eval] selfCycle.t1.c: invalid value {d:{}} (does not satisfy matchN): 0 matched, expected 1:
  1698          //     ./yamlcycle.cue:14:5
  1699          //     ./yamlcycle.cue:14:12
  1700          //     ./yamlcycle.cue:15:5
  1701          // selfCycle.t1.c.d: invalid value {d:{}} (does not satisfy matchN): 0 matched, expected 1:
  1702          //     ./yamlcycle.cue:14:5
  1703          //     ./yamlcycle.cue:14:12
  1704          //     ./yamlcycle.cue:14:20
  1705          //     ./yamlcycle.cue:15:8
  1706          // selfCycle.t1.c.d.d: invalid value {d:{}} (does not satisfy matchN): 0 matched, expected 1:
  1707          //     ./yamlcycle.cue:14:5
  1708          //     ./yamlcycle.cue:14:12
  1709          //     ./yamlcycle.cue:14:20
  1710          //     ./yamlcycle.cue:15:8
  1711          // selfCycle.t1.c.d.d.d: structural cycle:
  1712          //     ./yamlcycle.cue:14:5
  1713          d: (struct){
  1714          }
  1715        }
  1716      }
  1717      t2: (_|_){
  1718        // [eval]
  1719        c: (_|_){
  1720          // [eval] selfCycle.t2.c: invalid value {} (does not satisfy matchN): 0 matched, expected 1:
  1721          //     ./yamlcycle.cue:20:5
  1722          //     ./yamlcycle.cue:20:12
  1723          //     ./yamlcycle.cue:21:5
  1724          // selfCycle.t2.c.d: invalid value {} (does not satisfy matchN): 0 matched, expected 1:
  1725          //     ./yamlcycle.cue:20:5
  1726          //     ./yamlcycle.cue:20:12
  1727          //     ./yamlcycle.cue:20:20
  1728          // selfCycle.t2.c.d.d: structural cycle:
  1729          //     ./yamlcycle.cue:20:5
  1730        }
  1731      }
  1732      yamlVal: (_|_){
  1733        // [eval]
  1734        t1: (_|_){
  1735          // [eval]
  1736          x: (_|_){
  1737            // [eval] selfCycle.yamlVal.t1.x.y.y: structural cycle:
  1738            //     ./yamlcycle.cue:24:22
  1739          }
  1740        }
  1741        t2: (_|_){
  1742          // [eval]
  1743          x: (_|_){
  1744            // [eval] selfCycle.yamlVal.t2.x.y.y: structural cycle:
  1745            //     ./yamlcycle.cue:32:22
  1746          }
  1747        }
  1748      }
  1749      yamlFun: (_|_){
  1750        // [eval]
  1751        t1: (_|_){
  1752          // [structural cycle]
  1753          x: (_|_){
  1754            // [structural cycle] selfCycle.yamlFun.t1.x.y.y: structural cycle:
  1755            //     ./yamlcycle.cue:36:29
  1756          }
  1757        }
  1758        t2: (_|_){
  1759          // [eval]
  1760          z: (_|_){
  1761            // [eval]
  1762            y: (_|_){
  1763              // [eval] selfCycle.yamlFun.t2.x.y.y: structural cycle:
  1764              //     ./yamlcycle.cue:41:28
  1765            }
  1766          }
  1767          x: (_|_){
  1768            // [eval] selfCycle.yamlFun.t2.x.y.y: structural cycle:
  1769            //     ./yamlcycle.cue:41:28
  1770          }
  1771        }
  1772      }
  1773      yamlValidatePartial: (_|_){
  1774        // [structural cycle]
  1775        x: (_|_){
  1776          // [structural cycle] selfCycle.yamlValidatePartial.x.y.y: structural cycle:
  1777          //     ./yamlcycle.cue:44:29
  1778        }
  1779      }
  1780    }
  1781  }
  1782  -- out/compile --
  1783  --- cycle.cue
  1784  {
  1785    noCycle: {
  1786      t1: {
  1787        〈0;_s〉
  1788        _s: {
  1789          #x: matchN(1, [
  1790            〈2;_s〉,
  1791          ])
  1792          #x: {}
  1793        }
  1794      }
  1795    }
  1796    issue3649: {
  1797      noCycle: {
  1798        t1: {
  1799          data: 〈0;#c〉
  1800          data: {
  1801            a: {
  1802              b: "foo"
  1803            }
  1804          }
  1805          #c: {
  1806            b?: string
  1807            a?: matchN(1, [
  1808              〈2;#c〉,
  1809            ])
  1810          }
  1811        }
  1812      }
  1813    }
  1814    issue3649: {
  1815      noCycle: {
  1816        t2: {
  1817          x: 〈0;c〉
  1818          x: {
  1819            y: {
  1820              a: {
  1821                d: {
  1822                  b: "foo"
  1823                }
  1824              }
  1825            }
  1826          }
  1827          c: {
  1828            b?: string
  1829            y: {
  1830              a?: matchN(1, [
  1831                {
  1832                  d: 〈4;c〉
  1833                },
  1834              ])
  1835            }
  1836          }
  1837        }
  1838      }
  1839    }
  1840    issue3649: {
  1841      cycle: {
  1842        t1: {
  1843          data: 〈0;#c〉
  1844          data: {
  1845            a: {
  1846              b: "foo"
  1847            }
  1848          }
  1849          #c: {
  1850            b: string
  1851            a: matchN(1, [
  1852              〈2;#c〉,
  1853            ])
  1854          }
  1855        }
  1856      }
  1857    }
  1858  }
  1859  --- in.cue
  1860  {
  1861    builtinCyclePerm0: {
  1862      X: "mod.test"
  1863      Y: {
  1864        #components: 〈import;regexp〉.FindNamedSubmatch("^(?P<host>[[:alnum:].]+)$", 〈1;X〉)
  1865        host: 〈0;#components〉.host
  1866      }
  1867      X: 〈0;Y〉.host
  1868    }
  1869    builtinCyclePerm1: {
  1870      X: 〈0;Y〉.host
  1871      Y: {
  1872        #components: 〈import;regexp〉.FindNamedSubmatch("^(?P<host>[[:alnum:].]+)$", 〈1;X〉)
  1873        host: 〈0;#components〉.host
  1874      }
  1875      X: "mod.test"
  1876    }
  1877    builtinCyclePerm2: {
  1878      Y: {
  1879        #components: 〈import;regexp〉.FindNamedSubmatch("^(?P<host>[[:alnum:].]+)$", 〈1;X〉)
  1880        host: 〈0;#components〉.host
  1881      }
  1882      X: 〈0;Y〉.host
  1883      X: "mod.test"
  1884    }
  1885    builtinCyclePerm3: {
  1886      Y: {
  1887        #components: 〈import;regexp〉.FindNamedSubmatch("^(?P<host>[[:alnum:].]+)$", 〈1;X〉)
  1888        host: 〈0;#components〉.host
  1889      }
  1890      X: "mod.test"
  1891      X: 〈0;Y〉.host
  1892    }
  1893    builtinCyclePerm4: {
  1894      X: "mod.test"
  1895      X: 〈0;Y〉.host
  1896      Y: {
  1897        #components: 〈import;regexp〉.FindNamedSubmatch("^(?P<host>[[:alnum:].]+)$", 〈1;X〉)
  1898        host: 〈0;#components〉.host
  1899      }
  1900    }
  1901    builtinCyclePerm5: {
  1902      X: 〈0;Y〉.host
  1903      X: "mod.test"
  1904      Y: {
  1905        #components: 〈import;regexp〉.FindNamedSubmatch("^(?P<host>[[:alnum:].]+)$", 〈1;X〉)
  1906        host: 〈0;#components〉.host
  1907      }
  1908    }
  1909  }
  1910  --- issue3634.cue
  1911  {
  1912    issue3634: {
  1913      full: {
  1914        #Schema: {
  1915          required?: [
  1916            ...string,
  1917          ]
  1918          properties?: {
  1919            [string]: (null|〈2;#Schema〉)
  1920          }
  1921        }
  1922        out: len(([
  1923          ...〈1;#Schema〉,
  1924        ] & 〈import;list〉.Repeat([
  1925          {
  1926            〈2;#Schema〉
  1927            properties: {
  1928              foo: {
  1929                required: [
  1930                  "bar",
  1931                  "baz",
  1932                ]
  1933              }
  1934            }
  1935          },
  1936        ], 3)))
  1937      }
  1938    }
  1939    issue3634: {
  1940      reduced: {
  1941        #D: {
  1942          b?: int
  1943          a?: 〈1;#D〉
  1944        }
  1945        out: len((〈0;#D〉 & 〈import;list〉.Repeat([
  1946          (〈1;#D〉 & {
  1947            a: {
  1948              b: 1
  1949            }
  1950          }),
  1951        ], 1)[0]))
  1952      }
  1953    }
  1954  }
  1955  --- jsoncycle.cue
  1956  {
  1957    jsonCycle: {
  1958      t1: {
  1959        x: {
  1960          y: 〈import;"encoding/json"〉.Validate(〈1;x〉)
  1961        }
  1962        x: {
  1963          y: "{}"
  1964        }
  1965      }
  1966    }
  1967  }
  1968  --- listmatchncycle.cue
  1969  {
  1970    listMatchN: {
  1971      structCycle: {
  1972        x: {
  1973          y: 〈import;list〉.MatchN(1, 〈1;x〉)
  1974        }
  1975        x: {
  1976          y: [
  1977            {},
  1978          ]
  1979        }
  1980      }
  1981    }
  1982    listMatchN: {
  1983      ok: {
  1984        x: {
  1985          y?: 〈import;list〉.MatchN(1, 〈1;x〉)
  1986        }
  1987        z: 〈0;x〉
  1988        z: {
  1989          y: [
  1990            {},
  1991          ]
  1992        }
  1993      }
  1994    }
  1995  }
  1996  --- matchn.cue
  1997  {
  1998    issue3410: {
  1999      〈0;_s〉
  2000      _s: {
  2001        #x: matchN(1, [
  2002          〈2;_s〉,
  2003          [
  2004            ...〈3;_s〉,
  2005          ],
  2006        ])
  2007      }
  2008    }
  2009    issue3420: {
  2010      matches1: {
  2011        #S: matchN(1, [
  2012          _,
  2013          _|_(explicit error (_|_ literal) in source),
  2014        ])
  2015        s: 2
  2016      }
  2017    }
  2018    issue3443: {
  2019      matchIf: {
  2020        #S: 〈1;matchIf〉({
  2021          x?: "b"
  2022        }, {
  2023          n?: (〈1;#S〉 & (int|{}))
  2024        }, _)
  2025      }
  2026      noCycle: {
  2027        #S: matchN(1, [
  2028          {
  2029            n?: (〈2;#S〉 & (int|{}))
  2030          },
  2031        ])
  2032        noHang: {
  2033          s: 〈1;#S〉
  2034          s: {
  2035            n: {
  2036              n: _
  2037            }
  2038          }
  2039        }
  2040      }
  2041      noCycle2: {
  2042        #S: matchN(1, [
  2043          {
  2044            n?: (int|〈2;#S〉)
  2045          },
  2046        ])
  2047      }
  2048      cycle1: {
  2049        #S: matchN(1, [
  2050          {
  2051            n: 〈2;#S〉
  2052          },
  2053        ])
  2054        ok: {
  2055          s: 〈1;#S〉
  2056          s: _
  2057        }
  2058        cycle: {
  2059          s: 〈1;#S〉
  2060          s: {
  2061            n: {
  2062              n: _
  2063            }
  2064          }
  2065        }
  2066      }
  2067      cycle2: {
  2068        fail: {
  2069          #S: (matchN(1, [
  2070            {
  2071              n: 〈2;#S〉
  2072            },
  2073          ]) & {
  2074            n: {
  2075              n: {
  2076                n: _
  2077              }
  2078            }
  2079          })
  2080        }
  2081      }
  2082    }
  2083    issue3633: {
  2084      final: {
  2085        data: ({} & 〈0;#s〉)
  2086        #s: matchN(1, [
  2087          matchN(1, [
  2088            {
  2089              a!: _
  2090            },
  2091          ]),
  2092        ])
  2093      }
  2094    }
  2095  }
  2096  --- yamlcycle.cue
  2097  {
  2098    yamlNoCycle: {
  2099      #c: {
  2100        b?: string
  2101        a?: 〈import;"encoding/yaml"〉.Validate(〈1;#c〉)
  2102      }
  2103      data: 〈0;#c〉
  2104      data: {
  2105        a: "{a: \"b: foo\"}"
  2106      }
  2107    }
  2108    selfCycle: {
  2109      t1: {
  2110        c: matchN(1, [
  2111          {
  2112            d: 〈2;c〉
  2113          },
  2114        ])
  2115        c: {
  2116          d: {}
  2117        }
  2118      }
  2119    }
  2120    selfCycle: {
  2121      t2: {
  2122        c: matchN(1, [
  2123          {
  2124            d: 〈2;c〉
  2125          },
  2126        ])
  2127        c: {}
  2128      }
  2129    }
  2130    selfCycle: {
  2131      yamlVal: {
  2132        t1: {
  2133          x: {
  2134            y: 〈import;"encoding/yaml"〉.Validate(〈1;x〉)
  2135          }
  2136          x: {
  2137            y: "{}"
  2138          }
  2139        }
  2140      }
  2141    }
  2142    selfCycle: {
  2143      yamlVal: {
  2144        t2: {
  2145          x: {
  2146            y: 〈import;"encoding/yaml"〉.Validate(〈1;x〉)
  2147          }
  2148          x: {
  2149            y: "{}"
  2150          }
  2151          x: {
  2152            y: 〈import;"encoding/yaml"〉.Validate(〈1;x〉)
  2153          }
  2154          x: {
  2155            y: "{}"
  2156          }
  2157        }
  2158      }
  2159    }
  2160    selfCycle: {
  2161      yamlFun: {
  2162        t1: {
  2163          x: {
  2164            y?: 〈import;"encoding/yaml"〉.Validate("{}", 〈1;x〉)
  2165          }
  2166        }
  2167      }
  2168    }
  2169    selfCycle: {
  2170      yamlFun: {
  2171        t2: {
  2172          z: (〈0;x〉 & _|_(no sharing))
  2173          z: {
  2174            y: "{}"
  2175          }
  2176          x: {
  2177            y: 〈import;"encoding/yaml"〉.Validate("{}", 〈1;x〉)
  2178          }
  2179        }
  2180      }
  2181    }
  2182    selfCycle: {
  2183      yamlValidatePartial: {
  2184        x: {
  2185          y: 〈import;"encoding/yaml"〉.ValidatePartial(〈1;x〉)
  2186        }
  2187        x: {
  2188          y: "{}"
  2189        }
  2190      }
  2191    }
  2192  }