cuelang.org/go@v0.10.1/cue/testdata/disjunctions/elimination.txtar (about)

     1  // Ensure that disjunction elimination is not done prematurely.
     2  
     3  // Issue #651
     4  
     5  -- in.cue --
     6  import "struct"
     7  
     8  // Closedness checks should not be triggered too early, or with an improper
     9  // subset of StructInfos. Blindly finalizing partial disjuncts will end up
    10  // doing a closedness check with not all embeddings present, which can lead to
    11  // a field being rejected prematurely.
    12  //
    13  // It should be recursively disabled.
    14  disambiguateClosed: {
    15  	b: #Def & a
    16  	a: #Def
    17  	#Def: {{x: true} | {y: true}}
    18  }
    19  
    20  // Checks should never be disabled for field matching.
    21  alwaysCheckMatchers1: {
    22  	b: {[=~"^xxxx$"]: int} | null
    23  	b: {c:            string} | null
    24  	b: c: "yyyyy"
    25  }
    26  
    27  alwaysCheckPatterns2: {
    28  	a: #X
    29  	a: b
    30  
    31  	b: #X
    32  	b: c: "yyyyy"
    33  
    34  	#X: string | {
    35  		c: string
    36  		{[=~"^xxxx$"]: int}
    37  	}
    38  }
    39  
    40  nestedNonMonotonic: resolved: n1: {
    41  	x: {a:    struct.MinFields(2)} | null
    42  	x: {a: c: 1} | null
    43  	x: {a: d: 1} | null
    44  }
    45  
    46  nestedNonMonotonic: resolved: n2: {
    47  	x: {a: b:    struct.MinFields(2)} | null
    48  	x: {a: b: c: 1} | null
    49  	x: {a: b: d: 1} | null
    50  }
    51  
    52  nestedNonMonotonic: eliminated: n1: p1: {
    53  	x: {a:    struct.MaxFields(1)} | null
    54  	x: {a: c: 1} | null
    55  	x: {a: d: 1} | null
    56  }
    57  
    58  nestedNonMonotonic: eliminated: n1: p2: {
    59  	x: {a: c: 1} | null
    60  	x: {a:    struct.MaxFields(1)} | null
    61  	x: {a: d: 1} | null
    62  }
    63  
    64  nestedNonMonotonic: eliminated: n1: p2: {
    65  	x: {a: c: 1} | null
    66  	x: {a: d: 1} | null
    67  	x: {a:    struct.MaxFields(1)} | null
    68  }
    69  
    70  nestedNonMonotonic: eliminated: n2: p1: {
    71  	x: {a: b:    struct.MaxFields(1)} | null
    72  	x: {a: b: c: 1} | null
    73  	x: {a: b: d: 1} | null
    74  }
    75  
    76  nestedNonMonotonic: eliminated: n2: p2: {
    77  	x: {a: b: c: 1} | null
    78  	x: {a: b:    struct.MaxFields(1)} | null
    79  	x: {a: b: d: 1} | null
    80  }
    81  
    82  nestedNonMonotonic: eliminated: n2: p2: {
    83  	x: {a: b: c: 1} | null
    84  	x: {a: b: d: 1} | null
    85  	x: {a: b:    struct.MaxFields(1)} | null
    86  }
    87  
    88  // TODO: should be incomplete.
    89  nestedNonMonotonic: incomplete: a: n1: p1: {
    90  	x: {a:    struct.MinFields(2)} | null
    91  	x: {a: c: 1} | null
    92  }
    93  
    94  // TODO: should be incomplete.
    95  nestedNonMonotonic: incomplete: a: n1: p2: {
    96  	x: {a: c: 1} | null
    97  	x: {a:    struct.MinFields(2)} | null
    98  }
    99  
   100  nestedNonMonotonic: incomplete: a: n2: p1: {
   101  	x: {a: b:    struct.MinFields(2)} | null
   102  	x: {a: b: c: 1} | null
   103  }
   104  
   105  nestedNonMonotonic: incomplete: a: n2: p2: {
   106  	x: {a: b: c: 1} | null
   107  	x: {a: b:    struct.MinFields(2)} | null
   108  }
   109  
   110  nestedNonMonotonic: incomplete: b: n1: p1: {
   111  	x: {a:    struct.MinFields(3)} | null
   112  	x: {a: c: 1} | null
   113  	x: {a: d: 1} | null
   114  }
   115  
   116  nestedNonMonotonic: incomplete: b: n1: p2: {
   117  	x: {a: c: 1} | null
   118  	x: {a:    struct.MinFields(3)} | null
   119  	x: {a: d: 1} | null
   120  }
   121  
   122  nestedNonMonotonic: incomplete: b: n1: p3: {
   123  	x: {a: c: 1} | null
   124  	x: {a: d: 1} | null
   125  	x: {a:    struct.MinFields(3)} | null
   126  }
   127  
   128  nestedNonMonotonic: incomplete: b: n2: p1: {
   129  	x: {a: b:    struct.MinFields(3)} | null
   130  	x: {a: b: c: 1} | null
   131  	x: {a: b: d: 1} | null
   132  }
   133  
   134  nestedNonMonotonic: incomplete: b: n2: p1: {
   135  	x: {a: b: c: 1} | null
   136  	x: {a: b:    struct.MinFields(3)} | null
   137  	x: {a: b: d: 1} | null
   138  }
   139  
   140  nestedNonMonotonic: incomplete: b: n2: p1: {
   141  	x: {a: b: c: 1} | null
   142  	x: {a: b: d: 1} | null
   143  	x: {a: b:    struct.MinFields(3)} | null
   144  }
   145  
   146  preserveClosedness: small: p1: {
   147  	#A: #B & {a: string}
   148  	#B: {
   149  		*{} | {a: string}
   150  		*{} | {b: int}
   151  	}
   152  }
   153  
   154  preserveClosedness: small: p2: {
   155  	#A: #B & {a: string}
   156  	#B: {
   157  		{a: string} | *{}
   158  		*{} | {b: int}
   159  	}
   160  }
   161  
   162  preserveClosedness: medium: p1: {
   163  	#A: #B & {a: string}
   164  	#B: {
   165  		*{} | {a: string} | {b: string}
   166  		*{} | {c: int} | {d: string}
   167  	}
   168  }
   169  
   170  preserveClosedness: medium: p2: {
   171  	#A: #B & {a: string}
   172  	#B: {
   173  		{a: string} | *{} | {b: string}
   174  		*{} | {c: int} | {d: string}
   175  	}
   176  }
   177  
   178  preserveClosedness: medium: p3: {
   179  	#A: #B & {a: string}
   180  	#B: {
   181  		{a: string} | {b: string} | *{}
   182  		*{} | {c: int} | {d: string}
   183  	}
   184  }
   185  
   186  // If an error occurred in the last disjunction, it may sometimes be propagated
   187  // to parent nodes. This, in turn, could lead to references to such field
   188  // to fail with that error.
   189  noChildError: _
   190  noChildError: issue1608: {
   191  	myValue: #type & {fieldName: "some string"}
   192  	#type: fieldName: #subtype
   193  
   194  	#subtype: string | {foo: string} | {bar: #subtype}
   195  }
   196  
   197  noChildError: t1: {
   198  	#D: {b: string} | {c: #D }
   199  	o: #D & {b: "test"}
   200  }
   201  
   202  noChildError: t2: {
   203  	o: #D & {b: "test"}
   204  	#D: {b: string} | {c: #D }
   205  }
   206  
   207  noChildError: t3: {
   208  	#D: {a: null} | {b: string} | {c: #D }
   209  	o: #D & {b: "test"}
   210  }
   211  
   212  noChildError: t4: {
   213  	o: #D & {b: "test"}
   214  	#D: {a: null} | {b: string} | {c: #D }
   215  }
   216  
   217  
   218  issue1924: t1: {
   219  	m: a: 2
   220  	x: *[m.b] | 2
   221  }
   222  issue1924: t2: {
   223  	m: a: 2
   224  	x: *{v: m.b} | 3
   225  }
   226  issue1924: t3: {
   227  	m: a: 2
   228  	x: *m.b | 1
   229  }
   230  
   231  // should eliminate erroneous comprehension and pass
   232  issue1838: t1: {
   233  	p?: []
   234  	a: [for k in p {k}] | null
   235  }
   236  issue1838: t2: {
   237  	p?: []
   238  	a: null | [for k in p {k}]
   239  }
   240  
   241  noHang: {
   242  	// This should terminate.
   243  	#T: ["a", #T] | ["d", ...#T]
   244  
   245  	x: #T
   246  
   247  	#X: x
   248  	#X: #T
   249  }
   250  
   251  issue1940: {
   252  	#T: ["a", #T] | ["b", #T] | ["c", #T] | ["d", [...#T]]
   253  
   254  	#A: type: #T
   255  
   256  	#B: [string]: #A
   257  
   258  	#C: #B & {
   259  		x: #A
   260  	}
   261  }
   262  
   263  -- issue2209full.cue --
   264  // TODO: fix
   265  
   266  issue2209: simplified: t1: {
   267  	#SpecFoo: foo: min: 1
   268  	#SpecBar: bar: min: 1
   269  	spec: bar: {}
   270  	spec:  #SpecFoo | #SpecBar
   271  	out: {
   272  		{nullFoo: null} | {nullBar: null}
   273  		{minFoo: int} | {minBar: int}
   274  		if X.bar != _|_ {
   275  			minBar: X.bar.min
   276  		}
   277  		X: spec
   278  	}
   279  }
   280  
   281  issue2209: simplified: t2: {
   282  	#SpecFoo: foo: {}
   283  	#SpecBar: bar: x: 1
   284  	spec: bar: {}
   285  	spec: *#SpecFoo | #SpecBar
   286  	if spec.bar != _|_ {
   287  		BAZ: spec.bar.x
   288  	}
   289  	{f1: int} | {b2: int}
   290  	{f2: int} | {b2: int}
   291  }
   292  
   293  // This test fails for 0.4 and 0.5.
   294  issue2209: simplified: t3: {
   295  	#A: v: 1
   296  	{f1: int} | {b2: int}
   297  	{f2: int} | {b2: int}
   298  	BAZ: S.y
   299  	S: *#A | #B
   300  	#B: {x: 1, y: 1}
   301  	S: x: 1
   302  }
   303  
   304  issue2209: full: {
   305  	Foo: #Abstract & {spec: foo: {}}
   306  	Bar: #Abstract & {spec: bar: {}}
   307  
   308  	#Abstract: X={
   309  		spec: _#Spec
   310  
   311  		resource: _Thing & {_X: spec: X.spec}
   312  	}
   313  
   314  	_#Spec: *_#SpecFoo | _#SpecBar
   315  
   316  	_#SpecFoo: {
   317  		foo: {
   318  			min: int | *10
   319  			max: int | *20
   320  		}
   321  	}
   322  
   323  	_#SpecBar: {
   324  		bar: {
   325  			min: int | *30
   326  			max: int | *40
   327  		}
   328  	}
   329  
   330  	_Thing: #Constrained & {
   331  		_X: _
   332  
   333  		spec: {
   334  			if _X.spec.foo != _|_ {
   335  				minFoo: _X.spec.foo.min
   336  				maxFoo: _X.spec.foo.max
   337  			}
   338  
   339  			if _X.spec.bar != _|_ {
   340  				minBar: _X.spec.bar.min
   341  				maxBar: _X.spec.bar.max
   342  			}
   343  		}
   344  	}
   345  
   346  	#Constrained: #Base & {
   347  		spec: {
   348  			minFoo:  int | *10
   349  			maxFoo:  int | *20
   350  			minBar?: null
   351  			maxBar?: null
   352  		} | {
   353  			minBar:  int | *30
   354  			maxBar:  int | *40
   355  			minFoo?: null
   356  			maxFoo?: null
   357  		}
   358  
   359  		spec: *{
   360  			fuga?: null
   361  		} | {
   362  			hoge?: null
   363  		}
   364  	}
   365  
   366  	#Base: {
   367  		spec: {
   368  			minFoo?: null | int
   369  			maxFoo?: null | int
   370  			minBar?: null | int
   371  			maxBar?: null | int
   372  
   373  			hoge?: null | bool
   374  			fuga?: null | bool
   375  		}
   376  	}
   377  }
   378  
   379  
   380  -- issue2246.cue --
   381  issue2246: simplified: {
   382  	#FormFoo: fooID: string
   383  	#FormBar: barID: string
   384  	#Form: { #FormFoo | #FormBar }
   385  
   386  	data: {fooID: "123"}
   387  	out1: #Form & data
   388  	out2: #Form & out1
   389  }
   390  issue2246: full: {
   391  	data: forms: [{
   392  		fooID: "00-0000001"
   393  	}]
   394  
   395  	form1040: (#compute & {in: data}).out
   396  
   397  	#K1: {
   398  		#_base: common: 3
   399  		#FormFoo: {
   400  			#_base
   401  			fooID: string
   402  		}
   403  		#FormBar: {
   404  			#_base
   405  			barID: string
   406  		}
   407  		#Form: {
   408  			#FormFoo | #FormBar
   409  		}
   410  	}
   411  
   412  	#Input: {
   413  		forms: [...#K1.#Form]
   414  	}
   415  
   416  	#summarizeReturn: {
   417  		in:  #Input
   418  		out: [for k in in.forms { k.common }]
   419  	}
   420  
   421  	#compute: {
   422  		in:  #Input
   423  		out: (#summarizeReturn & {"in": in}).out
   424  	}
   425  }
   426  
   427  -- issue2263.cue --
   428  issue2263: simplified: {
   429  	metrics: #Metric
   430  	#Metric: {
   431  		#IDSource | {}
   432  		#TargetAverage | {}
   433  	}
   434  
   435  	metrics: {
   436  		id:  "foo"
   437  		avg: 60
   438  	}
   439  
   440  	#IDSource: id: string
   441  	#TargetAverage: avg: number
   442  }
   443  issue2263: full: {
   444  	metrics: [...#Metric]
   445  
   446  	metrics: [{
   447  		id:  "foo"
   448  		avg: 60
   449  	}, {
   450  		id:    "bar"
   451  		value: 80
   452  	}, {
   453  		uri: "baz"
   454  		avg: 70
   455  	}, {
   456  		uri:   "qux"
   457  		value: 90
   458  	}]
   459  
   460  	#Metric: {
   461  		#Source
   462  		#Target
   463  	}
   464  
   465  	#Source:
   466  		#IDSource |
   467  		#URISource
   468  
   469  	#Target:
   470  		#TargetAverage |
   471  		#TargetValue
   472  
   473  	#IDSource: {
   474  		id: string
   475  	}
   476  
   477  	#URISource: {
   478  		uri: string
   479  	}
   480  
   481  	#TargetAverage: {
   482  		avg: number
   483  	}
   484  
   485  	#TargetValue: {
   486  		value: number
   487  	}
   488  }
   489  -- issue1417.cue --
   490  issue1417: {
   491  	#ID: !~"^a" | =~"^ab$" | =~"^aB$"
   492  	#ID: =~"^a" | !~"[A-Z]"
   493  	ids: [...#ID] & ["xyz", "ab", "aB"]
   494  }
   495  -- issue3149.cue --
   496  issue3149: {
   497  	#valid: {
   498  		name!: ( (=~"^Foo") | "an exception") & ( (=~"Foo$") | "an exception")
   499  	}
   500  	list: [...#valid]
   501  	list: [
   502  		{name: "FooBarFoo"},
   503  		{name: "FooBazFoo"},
   504  		{name: "FooQuuxFoo"},
   505  		{name: "an exception"},
   506  	]
   507  }
   508  -- issue770.cue --
   509  issue770: {
   510  	#A: {
   511  		v: "a" | "b" | "c"
   512  	}
   513  	h: [string]: #A
   514  	h: a: {
   515  		v: *"a" | string
   516  	}
   517  	h: [=~"^b"]: {
   518  		v: *h.a.v | string
   519  	}
   520  	h: [=~"^c"]: {
   521  		v: *h.b.v | string
   522  	}
   523  	h: b:   _
   524  	h: boo: _
   525  	h: c:   _
   526  	h: coo: _
   527  }
   528  -- out/evalalpha --
   529  (struct){
   530    disambiguateClosed: (struct){
   531      b: (#struct){ |((#struct){
   532          x: (bool){ true }
   533        }, (#struct){
   534          y: (bool){ true }
   535        }) }
   536      a: (#struct){ |((#struct){
   537          x: (bool){ true }
   538        }, (#struct){
   539          y: (bool){ true }
   540        }) }
   541      #Def: (#struct){ |((#struct){
   542          x: (bool){ true }
   543        }, (#struct){
   544          y: (bool){ true }
   545        }) }
   546    }
   547    alwaysCheckMatchers1: (struct){
   548      b: (struct){
   549        c: (string){ "yyyyy" }
   550      }
   551    }
   552    alwaysCheckPatterns2: (struct){
   553      a: (#struct){
   554        c: (string){ "yyyyy" }
   555      }
   556      b: (#struct){
   557        c: (string){ "yyyyy" }
   558      }
   559      #X: ((string|struct)){ |((string){ string }, (#struct){
   560          c: (string){ string }
   561        }) }
   562    }
   563    nestedNonMonotonic: (struct){
   564      resolved: (struct){
   565        n1: (struct){
   566          x: ((null|struct)){ |((struct){
   567              a: (struct){
   568                c: (int){ 1 }
   569                d: (int){ 1 }
   570              }
   571            }, (null){ null }) }
   572        }
   573        n2: (struct){
   574          x: ((null|struct)){ |((struct){
   575              a: (struct){
   576                b: (struct){
   577                  c: (int){ 1 }
   578                  d: (int){ 1 }
   579                }
   580              }
   581            }, (null){ null }) }
   582        }
   583      }
   584      eliminated: (struct){
   585        n1: (struct){
   586          p1: (struct){
   587            x: (null){ null }
   588          }
   589          p2: (struct){
   590            x: (null){ null }
   591          }
   592        }
   593        n2: (struct){
   594          p1: (struct){
   595            x: (null){ null }
   596          }
   597          p2: (struct){
   598            x: (null){ null }
   599          }
   600        }
   601      }
   602      incomplete: (struct){
   603        a: (struct){
   604          n1: (struct){
   605            p1: (struct){
   606              x: (null){ null }
   607            }
   608            p2: (struct){
   609              x: (null){ null }
   610            }
   611          }
   612          n2: (struct){
   613            p1: (struct){
   614              x: ((null|struct)){ |((struct){
   615                  a: (struct){
   616                    b: (_|_){
   617                      // [incomplete] nestedNonMonotonic.incomplete.a.n2.p1.x.a.b: invalid value {c:1} (does not satisfy struct.MinFields(2)): len(fields) < MinFields(2) (1 < 2):
   618                      //     ./in.cue:96:15
   619                      //     ./in.cue:96:32
   620                      c: (int){ 1 }
   621                    }
   622                  }
   623                }, (null){ null }) }
   624            }
   625            p2: (struct){
   626              x: ((null|struct)){ |((struct){
   627                  a: (struct){
   628                    b: (_|_){
   629                      // [incomplete] nestedNonMonotonic.incomplete.a.n2.p2.x.a.b: invalid value {c:1} (does not satisfy struct.MinFields(2)): len(fields) < MinFields(2) (1 < 2):
   630                      //     ./in.cue:102:15
   631                      //     ./in.cue:102:32
   632                      c: (int){ 1 }
   633                    }
   634                  }
   635                }, (null){ null }) }
   636            }
   637          }
   638        }
   639        b: (struct){
   640          n1: (struct){
   641            p1: (struct){
   642              x: (null){ null }
   643            }
   644            p2: (struct){
   645              x: (null){ null }
   646            }
   647            p3: (struct){
   648              x: (null){ null }
   649            }
   650          }
   651          n2: (struct){
   652            p1: (struct){
   653              x: ((null|struct)){ |((struct){
   654                  a: (struct){
   655                    b: (_|_){
   656                      // [incomplete] nestedNonMonotonic.incomplete.b.n2.p1.x.a.b: invalid value {c:1,d:1} (does not satisfy struct.MinFields(3)): len(fields) < MinFields(3) (2 < 3):
   657                      //     ./in.cue:138:15
   658                      //     ./in.cue:138:32
   659                      c: (int){ 1 }
   660                      d: (int){ 1 }
   661                    }
   662                  }
   663                }, (null){ null }) }
   664            }
   665          }
   666        }
   667      }
   668    }
   669    preserveClosedness: (struct){
   670      small: (struct){
   671        p1: (struct){
   672          #A: (#struct){ |(*(#struct){
   673              a: (string){ string }
   674            }, (#struct){
   675              a: (string){ string }
   676              b: (int){ int }
   677            }) }
   678          #B: (#struct){ |(*(#struct){
   679            }, (#struct){
   680              b: (int){ int }
   681            }, (#struct){
   682              a: (string){ string }
   683            }, (#struct){
   684              a: (string){ string }
   685              b: (int){ int }
   686            }) }
   687        }
   688        p2: (struct){
   689          #A: (#struct){ |(*(#struct){
   690              a: (string){ string }
   691            }, (#struct){
   692              a: (string){ string }
   693              b: (int){ int }
   694            }) }
   695          #B: (#struct){ |(*(#struct){
   696            }, (#struct){
   697              a: (string){ string }
   698              b: (int){ int }
   699            }, (#struct){
   700              a: (string){ string }
   701            }, (#struct){
   702              b: (int){ int }
   703            }) }
   704        }
   705      }
   706      medium: (struct){
   707        p1: (struct){
   708          #A: (#struct){ |(*(#struct){
   709              a: (string){ string }
   710            }, (#struct){
   711              a: (string){ string }
   712              c: (int){ int }
   713            }, (#struct){
   714              a: (string){ string }
   715              d: (string){ string }
   716            }, (#struct){
   717              a: (string){ string }
   718              b: (string){ string }
   719            }, (#struct){
   720              a: (string){ string }
   721              b: (string){ string }
   722              c: (int){ int }
   723            }, (#struct){
   724              a: (string){ string }
   725              b: (string){ string }
   726              d: (string){ string }
   727            }) }
   728          #B: (#struct){ |(*(#struct){
   729            }, (#struct){
   730              c: (int){ int }
   731            }, (#struct){
   732              d: (string){ string }
   733            }, (#struct){
   734              a: (string){ string }
   735            }, (#struct){
   736              a: (string){ string }
   737              c: (int){ int }
   738            }, (#struct){
   739              a: (string){ string }
   740              d: (string){ string }
   741            }, (#struct){
   742              b: (string){ string }
   743            }, (#struct){
   744              b: (string){ string }
   745              c: (int){ int }
   746            }, (#struct){
   747              b: (string){ string }
   748              d: (string){ string }
   749            }) }
   750        }
   751        p2: (struct){
   752          #A: (#struct){ |(*(#struct){
   753              a: (string){ string }
   754            }, (#struct){
   755              a: (string){ string }
   756              c: (int){ int }
   757            }, (#struct){
   758              a: (string){ string }
   759              d: (string){ string }
   760            }, (#struct){
   761              a: (string){ string }
   762              b: (string){ string }
   763            }, (#struct){
   764              a: (string){ string }
   765              b: (string){ string }
   766              c: (int){ int }
   767            }, (#struct){
   768              a: (string){ string }
   769              b: (string){ string }
   770              d: (string){ string }
   771            }) }
   772          #B: (#struct){ |(*(#struct){
   773            }, (#struct){
   774              a: (string){ string }
   775              c: (int){ int }
   776            }, (#struct){
   777              a: (string){ string }
   778              d: (string){ string }
   779            }, (#struct){
   780              a: (string){ string }
   781            }, (#struct){
   782              c: (int){ int }
   783            }, (#struct){
   784              d: (string){ string }
   785            }, (#struct){
   786              b: (string){ string }
   787            }, (#struct){
   788              b: (string){ string }
   789              c: (int){ int }
   790            }, (#struct){
   791              b: (string){ string }
   792              d: (string){ string }
   793            }) }
   794        }
   795        p3: (struct){
   796          #A: (#struct){ |(*(#struct){
   797              a: (string){ string }
   798            }, (#struct){
   799              a: (string){ string }
   800              c: (int){ int }
   801            }, (#struct){
   802              a: (string){ string }
   803              d: (string){ string }
   804            }, (#struct){
   805              a: (string){ string }
   806              b: (string){ string }
   807            }, (#struct){
   808              a: (string){ string }
   809              b: (string){ string }
   810              c: (int){ int }
   811            }, (#struct){
   812              a: (string){ string }
   813              b: (string){ string }
   814              d: (string){ string }
   815            }) }
   816          #B: (#struct){ |(*(#struct){
   817            }, (#struct){
   818              a: (string){ string }
   819              c: (int){ int }
   820            }, (#struct){
   821              a: (string){ string }
   822              d: (string){ string }
   823            }, (#struct){
   824              b: (string){ string }
   825            }, (#struct){
   826              b: (string){ string }
   827              c: (int){ int }
   828            }, (#struct){
   829              b: (string){ string }
   830              d: (string){ string }
   831            }, (#struct){
   832              a: (string){ string }
   833            }, (#struct){
   834              c: (int){ int }
   835            }, (#struct){
   836              d: (string){ string }
   837            }) }
   838        }
   839      }
   840    }
   841    noChildError: (struct){
   842      issue1608: (struct){
   843        myValue: (#struct){
   844          fieldName: (string){ "some string" }
   845        }
   846        #type: (#struct){
   847          fieldName: ((string|struct)){ |((string){ string }, (#struct){
   848              foo: (string){ string }
   849            }) }
   850        }
   851        #subtype: ((string|struct)){ |((string){ string }, (#struct){
   852            foo: (string){ string }
   853          }) }
   854      }
   855      t1: (struct){
   856        #D: (#struct){
   857          b: (string){ string }
   858        }
   859        o: (#struct){
   860          b: (string){ "test" }
   861        }
   862      }
   863      t2: (struct){
   864        o: (#struct){
   865          b: (string){ "test" }
   866        }
   867        #D: (#struct){
   868          b: (string){ string }
   869        }
   870      }
   871      t3: (struct){
   872        #D: (#struct){ |((#struct){
   873            a: (null){ null }
   874          }, (#struct){
   875            b: (string){ string }
   876          }) }
   877        o: (#struct){
   878          b: (string){ "test" }
   879        }
   880      }
   881      t4: (struct){
   882        o: (#struct){ |((#struct){
   883            b: (string){ "test" }
   884            a: (null){ null }
   885          }, (#struct){
   886            b: (string){ "test" }
   887          }) }
   888        #D: (#struct){ |((#struct){
   889            a: (null){ null }
   890          }, (#struct){
   891            b: (string){ string }
   892          }) }
   893      }
   894    }
   895    issue1924: (struct){
   896      t1: (struct){
   897        m: (struct){
   898          a: (int){ 2 }
   899        }
   900        x: (int){ 2 }
   901      }
   902      t2: (struct){
   903        m: (struct){
   904          a: (int){ 2 }
   905        }
   906        x: (int){ 3 }
   907      }
   908      t3: (struct){
   909        m: (struct){
   910          a: (int){ 2 }
   911        }
   912        x: (int){ 1 }
   913      }
   914    }
   915    issue1838: (struct){
   916      t1: (struct){
   917        p?: (#list){
   918        }
   919        a: (null){ null }
   920      }
   921      t2: (struct){
   922        p?: (#list){
   923        }
   924        a: (null){ null }
   925      }
   926    }
   927    noHang: (struct){
   928      #T: (list){
   929        0: (string){ "d" }
   930      }
   931      x: ~(noHang.#T)
   932      #X: ~(noHang.#T)
   933    }
   934    issue1940: (struct){
   935      #T: (#list){
   936        0: (string){ "d" }
   937        1: (list){
   938        }
   939      }
   940      #A: (#struct){
   941        type: ~(issue1940.#T)
   942      }
   943      #B: (#struct){
   944      }
   945      #C: (#struct){
   946        x: (#struct){
   947          type: ~(issue1940.#T)
   948        }
   949      }
   950    }
   951    issue1417: (struct){
   952      #ID: (string){ |((string){ &(!~"^a", =~"^a") }, (string){ &(!~"^a", !~"[A-Z]") }, (string){ &(=~"^ab$", =~"^a") }, (string){ &(=~"^ab$", !~"[A-Z]") }, (string){ &(=~"^aB$", =~"^a") }, (string){ &(=~"^aB$", !~"[A-Z]") }) }
   953      ids: (#list){
   954        0: (string){ "xyz" }
   955        1: (string){ "ab" }
   956        2: (string){ "aB" }
   957      }
   958    }
   959    issue2209: (struct){
   960      simplified: (struct){
   961        t1: (struct){
   962          #SpecFoo: (#struct){
   963            foo: (#struct){
   964              min: (int){ 1 }
   965            }
   966          }
   967          #SpecBar: (#struct){
   968            bar: (#struct){
   969              min: (int){ 1 }
   970            }
   971          }
   972          spec: (#struct){
   973            bar: (#struct){
   974              min: (int){ 1 }
   975            }
   976          }
   977          out: (struct){ |((struct){
   978              X: (#struct){
   979                bar: (#struct){
   980                  min: (int){ 1 }
   981                }
   982              }
   983              nullFoo: (null){ null }
   984              minFoo: (int){ int }
   985            }, (struct){
   986              minBar: (int){ int }
   987              X: (#struct){
   988                bar: (#struct){
   989                  min: (int){ 1 }
   990                }
   991              }
   992              nullFoo: (null){ null }
   993            }, (struct){
   994              X: (#struct){
   995                bar: (#struct){
   996                  min: (int){ 1 }
   997                }
   998              }
   999              nullBar: (null){ null }
  1000              minFoo: (int){ int }
  1001            }, (struct){
  1002              minBar: (int){ int }
  1003              X: (#struct){
  1004                bar: (#struct){
  1005                  min: (int){ 1 }
  1006                }
  1007              }
  1008              nullBar: (null){ null }
  1009            }) }
  1010        }
  1011        t2: (_|_){
  1012          // [incomplete] issue2209.simplified.t2.BAZ: undefined field: x:
  1013          //     ./issue2209full.cue:24:17
  1014          #SpecFoo: (#struct){
  1015            foo: (#struct){
  1016            }
  1017          }
  1018          #SpecBar: (#struct){
  1019            bar: (#struct){
  1020              x: (int){ 1 }
  1021            }
  1022          }
  1023          spec: (struct){
  1024            bar: (struct){
  1025            }
  1026          }
  1027          BAZ: (_){ _ }
  1028        }
  1029        t3: (struct){ |((struct){
  1030            #A: (#struct){
  1031              v: (int){ 1 }
  1032            }
  1033            BAZ: (_){ _ }
  1034            S: (#struct){
  1035              x: (int){ 1 }
  1036              y: (int){ 1 }
  1037            }
  1038            #B: (#struct){
  1039              x: (int){ 1 }
  1040              y: (int){ 1 }
  1041            }
  1042            f1: (int){ int }
  1043            f2: (int){ int }
  1044          }, (struct){
  1045            #A: (#struct){
  1046              v: (int){ 1 }
  1047            }
  1048            BAZ: (_){ _ }
  1049            S: (#struct){
  1050              x: (int){ 1 }
  1051              y: (int){ 1 }
  1052            }
  1053            #B: (#struct){
  1054              x: (int){ 1 }
  1055              y: (int){ 1 }
  1056            }
  1057            f1: (int){ int }
  1058            b2: (int){ int }
  1059          }) }
  1060      }
  1061      full: (struct){
  1062        Foo: (#struct){
  1063          spec: (#struct){ |(*(#struct){
  1064              foo: (#struct){
  1065                min: (int){ |(*(int){ 10 }, (int){ int }) }
  1066                max: (int){ |(*(int){ 20 }, (int){ int }) }
  1067              }
  1068            }, (#struct){
  1069              foo: (struct){
  1070              }
  1071              bar: (#struct){
  1072                min: (int){ |(*(int){ 30 }, (int){ int }) }
  1073                max: (int){ |(*(int){ 40 }, (int){ int }) }
  1074              }
  1075            }) }
  1076          resource: (#struct){
  1077            _X: (#struct){
  1078              spec: (#struct){ |(*(#struct){
  1079                  foo: (#struct){
  1080                    min: (int){ |(*(int){ 10 }, (int){ int }) }
  1081                    max: (int){ |(*(int){ 20 }, (int){ int }) }
  1082                  }
  1083                }, (#struct){
  1084                  foo: (struct){
  1085                  }
  1086                  bar: (#struct){
  1087                    min: (int){ |(*(int){ 30 }, (int){ int }) }
  1088                    max: (int){ |(*(int){ 40 }, (int){ int }) }
  1089                  }
  1090                }) }
  1091            }
  1092            spec: (#struct){ |(*(#struct){
  1093                minFoo: (int){ |(*(int){ 10 }, (int){ int }) }
  1094                maxFoo: (int){ |(*(int){ 20 }, (int){ int }) }
  1095                minBar?: (null){ null }
  1096                maxBar?: (null){ null }
  1097                hoge?: ((null|bool)){ |((null){ null }, (bool){ bool }) }
  1098                fuga?: (null){ null }
  1099              }, (#struct){
  1100                minFoo: (int){ |(*(int){ 10 }, (int){ int }) }
  1101                maxFoo: (int){ |(*(int){ 20 }, (int){ int }) }
  1102                minBar?: (null){ null }
  1103                maxBar?: (null){ null }
  1104                hoge?: (null){ null }
  1105                fuga?: ((null|bool)){ |((null){ null }, (bool){ bool }) }
  1106              }) }
  1107          }
  1108        }
  1109        Bar: (#struct){
  1110          spec: (#struct){
  1111            bar: (#struct){
  1112              min: (int){ |(*(int){ 30 }, (int){ int }) }
  1113              max: (int){ |(*(int){ 40 }, (int){ int }) }
  1114            }
  1115          }
  1116          resource: (#struct){
  1117            _X: (#struct){
  1118              spec: ~(issue2209.full.Bar.spec)
  1119            }
  1120            spec: (#struct){ |(*(#struct){
  1121                minFoo?: (null){ null }
  1122                maxFoo?: (null){ null }
  1123                minBar: (int){ |(*(int){ 30 }, (int){ int }) }
  1124                maxBar: (int){ |(*(int){ 40 }, (int){ int }) }
  1125                hoge?: ((null|bool)){ |((null){ null }, (bool){ bool }) }
  1126                fuga?: (null){ null }
  1127              }, (#struct){
  1128                minFoo?: (null){ null }
  1129                maxFoo?: (null){ null }
  1130                minBar: (int){ |(*(int){ 30 }, (int){ int }) }
  1131                maxBar: (int){ |(*(int){ 40 }, (int){ int }) }
  1132                hoge?: (null){ null }
  1133                fuga?: ((null|bool)){ |((null){ null }, (bool){ bool }) }
  1134              }) }
  1135          }
  1136        }
  1137        #Abstract: (#struct){
  1138          spec: (#struct){ |(*(#struct){
  1139              foo: (#struct){
  1140                min: (int){ |(*(int){ 10 }, (int){ int }) }
  1141                max: (int){ |(*(int){ 20 }, (int){ int }) }
  1142              }
  1143            }, (#struct){
  1144              bar: (#struct){
  1145                min: (int){ |(*(int){ 30 }, (int){ int }) }
  1146                max: (int){ |(*(int){ 40 }, (int){ int }) }
  1147              }
  1148            }) }
  1149          resource: (#struct){
  1150            _X: (#struct){
  1151              spec: (#struct){ |(*(#struct){
  1152                  foo: (#struct){
  1153                    min: (int){ |(*(int){ 10 }, (int){ int }) }
  1154                    max: (int){ |(*(int){ 20 }, (int){ int }) }
  1155                  }
  1156                }, (#struct){
  1157                  bar: (#struct){
  1158                    min: (int){ |(*(int){ 30 }, (int){ int }) }
  1159                    max: (int){ |(*(int){ 40 }, (int){ int }) }
  1160                  }
  1161                }) }
  1162            }
  1163            spec: (#struct){ |(*(#struct){
  1164                minFoo: (int){ |(*(int){ 10 }, (int){ int }) }
  1165                maxFoo: (int){ |(*(int){ 20 }, (int){ int }) }
  1166                minBar?: (null){ null }
  1167                maxBar?: (null){ null }
  1168                hoge?: ((null|bool)){ |((null){ null }, (bool){ bool }) }
  1169                fuga?: (null){ null }
  1170              }, (#struct){
  1171                minFoo: (int){ |(*(int){ 10 }, (int){ int }) }
  1172                maxFoo: (int){ |(*(int){ 20 }, (int){ int }) }
  1173                minBar?: (null){ null }
  1174                maxBar?: (null){ null }
  1175                hoge?: (null){ null }
  1176                fuga?: ((null|bool)){ |((null){ null }, (bool){ bool }) }
  1177              }) }
  1178          }
  1179        }
  1180        _#Spec: (#struct){ |(*(#struct){
  1181            foo: (#struct){
  1182              min: (int){ |(*(int){ 10 }, (int){ int }) }
  1183              max: (int){ |(*(int){ 20 }, (int){ int }) }
  1184            }
  1185          }, (#struct){
  1186            bar: (#struct){
  1187              min: (int){ |(*(int){ 30 }, (int){ int }) }
  1188              max: (int){ |(*(int){ 40 }, (int){ int }) }
  1189            }
  1190          }) }
  1191        _#SpecFoo: (#struct){
  1192          foo: (#struct){
  1193            min: (int){ |(*(int){ 10 }, (int){ int }) }
  1194            max: (int){ |(*(int){ 20 }, (int){ int }) }
  1195          }
  1196        }
  1197        _#SpecBar: (#struct){
  1198          bar: (#struct){
  1199            min: (int){ |(*(int){ 30 }, (int){ int }) }
  1200            max: (int){ |(*(int){ 40 }, (int){ int }) }
  1201          }
  1202        }
  1203        _Thing: (#struct){
  1204          _X: (_){ _ }
  1205          spec: (#struct){ |(*(#struct){
  1206              minFoo: (int){ |(*(int){ 10 }, (int){ int }) }
  1207              maxFoo: (int){ |(*(int){ 20 }, (int){ int }) }
  1208              minBar?: (null){ null }
  1209              maxBar?: (null){ null }
  1210              hoge?: ((null|bool)){ |((null){ null }, (bool){ bool }) }
  1211              fuga?: (null){ null }
  1212            }, *(#struct){
  1213              minFoo?: (null){ null }
  1214              maxFoo?: (null){ null }
  1215              minBar: (int){ |(*(int){ 30 }, (int){ int }) }
  1216              maxBar: (int){ |(*(int){ 40 }, (int){ int }) }
  1217              hoge?: ((null|bool)){ |((null){ null }, (bool){ bool }) }
  1218              fuga?: (null){ null }
  1219            }, (#struct){
  1220              minFoo: (int){ |(*(int){ 10 }, (int){ int }) }
  1221              maxFoo: (int){ |(*(int){ 20 }, (int){ int }) }
  1222              minBar?: (null){ null }
  1223              maxBar?: (null){ null }
  1224              hoge?: (null){ null }
  1225              fuga?: ((null|bool)){ |((null){ null }, (bool){ bool }) }
  1226            }, (#struct){
  1227              minFoo?: (null){ null }
  1228              maxFoo?: (null){ null }
  1229              minBar: (int){ |(*(int){ 30 }, (int){ int }) }
  1230              maxBar: (int){ |(*(int){ 40 }, (int){ int }) }
  1231              hoge?: (null){ null }
  1232              fuga?: ((null|bool)){ |((null){ null }, (bool){ bool }) }
  1233            }) }
  1234        }
  1235        #Constrained: (#struct){
  1236          spec: (#struct){ |(*(#struct){
  1237              minFoo: (int){ |(*(int){ 10 }, (int){ int }) }
  1238              maxFoo: (int){ |(*(int){ 20 }, (int){ int }) }
  1239              minBar?: (null){ null }
  1240              maxBar?: (null){ null }
  1241              hoge?: ((null|bool)){ |((null){ null }, (bool){ bool }) }
  1242              fuga?: (null){ null }
  1243            }, *(#struct){
  1244              minFoo?: (null){ null }
  1245              maxFoo?: (null){ null }
  1246              minBar: (int){ |(*(int){ 30 }, (int){ int }) }
  1247              maxBar: (int){ |(*(int){ 40 }, (int){ int }) }
  1248              hoge?: ((null|bool)){ |((null){ null }, (bool){ bool }) }
  1249              fuga?: (null){ null }
  1250            }, (#struct){
  1251              minFoo: (int){ |(*(int){ 10 }, (int){ int }) }
  1252              maxFoo: (int){ |(*(int){ 20 }, (int){ int }) }
  1253              minBar?: (null){ null }
  1254              maxBar?: (null){ null }
  1255              hoge?: (null){ null }
  1256              fuga?: ((null|bool)){ |((null){ null }, (bool){ bool }) }
  1257            }, (#struct){
  1258              minFoo?: (null){ null }
  1259              maxFoo?: (null){ null }
  1260              minBar: (int){ |(*(int){ 30 }, (int){ int }) }
  1261              maxBar: (int){ |(*(int){ 40 }, (int){ int }) }
  1262              hoge?: (null){ null }
  1263              fuga?: ((null|bool)){ |((null){ null }, (bool){ bool }) }
  1264            }) }
  1265        }
  1266        #Base: (#struct){
  1267          spec: (#struct){
  1268            minFoo?: ((null|int)){ |((null){ null }, (int){ int }) }
  1269            maxFoo?: ((null|int)){ |((null){ null }, (int){ int }) }
  1270            minBar?: ((null|int)){ |((null){ null }, (int){ int }) }
  1271            maxBar?: ((null|int)){ |((null){ null }, (int){ int }) }
  1272            hoge?: ((null|bool)){ |((null){ null }, (bool){ bool }) }
  1273            fuga?: ((null|bool)){ |((null){ null }, (bool){ bool }) }
  1274          }
  1275        }
  1276      }
  1277    }
  1278    issue2246: (struct){
  1279      simplified: (struct){
  1280        #FormFoo: (#struct){
  1281          fooID: (string){ string }
  1282        }
  1283        #FormBar: (#struct){
  1284          barID: (string){ string }
  1285        }
  1286        #Form: (#struct){ |((#struct){
  1287            fooID: (string){ string }
  1288          }, (#struct){
  1289            barID: (string){ string }
  1290          }) }
  1291        data: (struct){
  1292          fooID: (string){ "123" }
  1293        }
  1294        out1: (#struct){
  1295          fooID: (string){ "123" }
  1296        }
  1297        out2: (#struct){
  1298          fooID: (string){ "123" }
  1299        }
  1300      }
  1301      full: (struct){
  1302        data: (struct){
  1303          forms: (#list){
  1304            0: (struct){
  1305              fooID: (string){ "00-0000001" }
  1306            }
  1307          }
  1308        }
  1309        form1040: (#list){
  1310          0: (int){ 3 }
  1311        }
  1312        #K1: (#struct){
  1313          #_base: (#struct){
  1314            common: (int){ 3 }
  1315          }
  1316          #FormFoo: (#struct){
  1317            fooID: (string){ string }
  1318            common: (int){ 3 }
  1319          }
  1320          #FormBar: (#struct){
  1321            barID: (string){ string }
  1322            common: (int){ 3 }
  1323          }
  1324          #Form: (#struct){ |((#struct){
  1325              fooID: (string){ string }
  1326              common: (int){ 3 }
  1327            }, (#struct){
  1328              barID: (string){ string }
  1329              common: (int){ 3 }
  1330            }) }
  1331        }
  1332        #Input: (#struct){
  1333          forms: (list){
  1334          }
  1335        }
  1336        #summarizeReturn: (#struct){
  1337          in: (#struct){
  1338            forms: (list){
  1339            }
  1340          }
  1341          out: (#list){
  1342          }
  1343        }
  1344        #compute: (#struct){
  1345          in: (#struct){
  1346            forms: (list){
  1347            }
  1348          }
  1349          out: (#list){
  1350          }
  1351        }
  1352      }
  1353    }
  1354    issue2263: (struct){
  1355      simplified: (struct){
  1356        metrics: (#struct){
  1357          id: (string){ "foo" }
  1358          avg: (int){ 60 }
  1359        }
  1360        #Metric: (#struct){ |((#struct){
  1361            id: (string){ string }
  1362            avg: (number){ number }
  1363          }, (#struct){
  1364            id: (string){ string }
  1365          }, (#struct){
  1366            avg: (number){ number }
  1367          }, (#struct){
  1368          }) }
  1369        #IDSource: (#struct){
  1370          id: (string){ string }
  1371        }
  1372        #TargetAverage: (#struct){
  1373          avg: (number){ number }
  1374        }
  1375      }
  1376      full: (struct){
  1377        metrics: (#list){
  1378          0: (#struct){ |((#struct){
  1379              id: (string){ "foo" }
  1380              avg: (int){ 60 }
  1381            }, (#struct){
  1382              id: (string){ "foo" }
  1383              avg: (int){ 60 }
  1384              value: (number){ number }
  1385            }, (#struct){
  1386              id: (string){ "foo" }
  1387              avg: (int){ 60 }
  1388              uri: (string){ string }
  1389            }, (#struct){
  1390              id: (string){ "foo" }
  1391              avg: (int){ 60 }
  1392              uri: (string){ string }
  1393              value: (number){ number }
  1394            }) }
  1395          1: (#struct){
  1396            id: (string){ "bar" }
  1397            value: (int){ 80 }
  1398          }
  1399          2: (#struct){
  1400            uri: (string){ "baz" }
  1401            avg: (int){ 70 }
  1402          }
  1403          3: (#struct){
  1404            uri: (string){ "qux" }
  1405            value: (int){ 90 }
  1406          }
  1407        }
  1408        #Metric: (#struct){ |((#struct){
  1409            id: (string){ string }
  1410            avg: (number){ number }
  1411          }, (#struct){
  1412            id: (string){ string }
  1413            value: (number){ number }
  1414          }, (#struct){
  1415            uri: (string){ string }
  1416            avg: (number){ number }
  1417          }, (#struct){
  1418            uri: (string){ string }
  1419            value: (number){ number }
  1420          }) }
  1421        #Source: (#struct){ |((#struct){
  1422            id: (string){ string }
  1423          }, (#struct){
  1424            uri: (string){ string }
  1425          }) }
  1426        #Target: (#struct){ |((#struct){
  1427            avg: (number){ number }
  1428          }, (#struct){
  1429            value: (number){ number }
  1430          }) }
  1431        #IDSource: (#struct){
  1432          id: (string){ string }
  1433        }
  1434        #URISource: (#struct){
  1435          uri: (string){ string }
  1436        }
  1437        #TargetAverage: (#struct){
  1438          avg: (number){ number }
  1439        }
  1440        #TargetValue: (#struct){
  1441          value: (number){ number }
  1442        }
  1443      }
  1444    }
  1445    issue3149: (struct){
  1446      #valid: (#struct){
  1447        name!: (string){ |((string){ &(=~"^Foo", =~"Foo$") }, (string){ "an exception" }) }
  1448      }
  1449      list: (#list){
  1450        0: (#struct){
  1451          name: (string){ "FooBarFoo" }
  1452        }
  1453        1: (#struct){
  1454          name: (string){ "FooBazFoo" }
  1455        }
  1456        2: (#struct){
  1457          name: (string){ "FooQuuxFoo" }
  1458        }
  1459        3: (#struct){
  1460          name: (string){ "an exception" }
  1461        }
  1462      }
  1463    }
  1464    issue770: (struct){
  1465      #A: (#struct){
  1466        v: (string){ |((string){ "a" }, (string){ "b" }, (string){ "c" }) }
  1467      }
  1468      h: (struct){
  1469        a: (#struct){
  1470          v: (string){ |(*(string){ "a" }, (string){ "b" }, (string){ "c" }) }
  1471        }
  1472        b: (#struct){
  1473          v: (string){ |(*(string){ "a" }, (string){ "b" }, (string){ "c" }) }
  1474        }
  1475        boo: (#struct){
  1476          v: (string){ |(*(string){ "a" }, (string){ "b" }, (string){ "c" }) }
  1477        }
  1478        c: (#struct){
  1479          v: (string){ |(*(string){ "a" }, (string){ "b" }, (string){ "c" }) }
  1480        }
  1481        coo: (#struct){
  1482          v: (string){ |(*(string){ "a" }, (string){ "b" }, (string){ "c" }) }
  1483        }
  1484      }
  1485    }
  1486  }
  1487  -- diff/-out/evalalpha<==>+out/eval --
  1488  diff old new
  1489  --- old
  1490  +++ new
  1491  @@ -1,58 +1,4 @@
  1492  -Errors:
  1493  -issue1417.ids.2: 2 errors in empty disjunction:
  1494  -issue2209.full.Bar.resource.spec: 6 errors in empty disjunction:
  1495  -issue2209.full.Bar.resource.spec.minBar: 2 errors in empty disjunction:
  1496  -issue2209.full.Bar.resource.spec.minBar: conflicting values null and int (mismatched types null and int):
  1497  -    ./issue2209full.cue:43:7
  1498  -    ./issue2209full.cue:48:13
  1499  -    ./issue2209full.cue:67:10
  1500  -    ./issue2209full.cue:83:16
  1501  -    ./issue2209full.cue:87:13
  1502  -    ./issue2209full.cue:107:20
  1503  -issue2209.full.Bar.resource.spec.minFoo: 2 errors in empty disjunction:
  1504  -issue2209.full.Bar.resource.spec.minFoo: conflicting values null and 10 (mismatched types null and int):
  1505  -    ./issue2209full.cue:43:7
  1506  -    ./issue2209full.cue:48:13
  1507  -    ./issue2209full.cue:55:16
  1508  -    ./issue2209full.cue:71:4
  1509  -    ./issue2209full.cue:72:13
  1510  -    ./issue2209full.cue:92:13
  1511  -issue2209.full.Bar.resource.spec.minFoo: conflicting values null and int (mismatched types null and int):
  1512  -    ./issue2209full.cue:43:7
  1513  -    ./issue2209full.cue:48:13
  1514  -    ./issue2209full.cue:67:10
  1515  -    ./issue2209full.cue:83:16
  1516  -    ./issue2209full.cue:92:13
  1517  -    ./issue2209full.cue:105:20
  1518  -issue3149.list.3.name: 2 errors in empty disjunction:
  1519  -issue1417.ids.1: invalid value "ab" (out of bound !~"^a"):
  1520  -    ./issue1417.cue:2:7
  1521  -    ./issue1417.cue:4:11
  1522  -    ./issue1417.cue:4:26
  1523  -issue1417.ids.2: invalid value "aB" (out of bound !~"^a"):
  1524  -    ./issue1417.cue:2:7
  1525  -    ./issue1417.cue:4:11
  1526  -    ./issue1417.cue:4:32
  1527  -issue1417.ids.2: invalid value "aB" (out of bound !~"[A-Z]"):
  1528  -    ./issue1417.cue:3:16
  1529  -    ./issue1417.cue:4:11
  1530  -    ./issue1417.cue:4:32
  1531  -issue2209.simplified.t3.BAZ: undefined field: y:
  1532  -    ./issue2209full.cue:35:9
  1533  -issue2209.full.Bar.resource.spec.minBar: undefined field: min:
  1534  -    ./issue2209full.cue:77:25
  1535  -issue3149.list.3.name: invalid value "an exception" (out of bound =~"^Foo"):
  1536  -    ./issue3149.cue:3:13
  1537  -    ./issue3149.cue:3:10
  1538  -    ./issue3149.cue:10:10
  1539  -issue3149.list.3.name: invalid value "an exception" (out of bound =~"Foo$"):
  1540  -    ./issue3149.cue:3:46
  1541  -    ./issue3149.cue:3:10
  1542  -    ./issue3149.cue:10:10
  1543  -
  1544  -Result:
  1545  -(_|_){
  1546  -  // [eval]
  1547  +(struct){
  1548     disambiguateClosed: (struct){
  1549       b: (#struct){ |((#struct){
  1550           x: (bool){ true }
  1551  @@ -143,7 +89,6 @@
  1552                       // [incomplete] nestedNonMonotonic.incomplete.a.n2.p1.x.a.b: invalid value {c:1} (does not satisfy struct.MinFields(2)): len(fields) < MinFields(2) (1 < 2):
  1553                       //     ./in.cue:96:15
  1554                       //     ./in.cue:96:32
  1555  -                    //     ./in.cue:97:12
  1556                       c: (int){ 1 }
  1557                     }
  1558                   }
  1559  @@ -155,7 +100,6 @@
  1560                     b: (_|_){
  1561                       // [incomplete] nestedNonMonotonic.incomplete.a.n2.p2.x.a.b: invalid value {c:1} (does not satisfy struct.MinFields(2)): len(fields) < MinFields(2) (1 < 2):
  1562                       //     ./in.cue:102:15
  1563  -                    //     ./in.cue:101:12
  1564                       //     ./in.cue:102:32
  1565                       c: (int){ 1 }
  1566                     }
  1567  @@ -181,16 +125,8 @@
  1568               x: ((null|struct)){ |((struct){
  1569                   a: (struct){
  1570                     b: (_|_){
  1571  -                    // [incomplete] nestedNonMonotonic.incomplete.b.n2.p1.x.a.b: invalid value {c:1 & 1 & 1,d:1 & 1 & 1} (does not satisfy struct.MinFields(3)): len(fields) < MinFields(3) (2 < 3):
  1572  +                    // [incomplete] nestedNonMonotonic.incomplete.b.n2.p1.x.a.b: invalid value {c:1,d:1} (does not satisfy struct.MinFields(3)): len(fields) < MinFields(3) (2 < 3):
  1573                       //     ./in.cue:138:15
  1574  -                    //     ./in.cue:124:15
  1575  -                    //     ./in.cue:125:12
  1576  -                    //     ./in.cue:126:12
  1577  -                    //     ./in.cue:130:12
  1578  -                    //     ./in.cue:131:15
  1579  -                    //     ./in.cue:132:12
  1580  -                    //     ./in.cue:136:12
  1581  -                    //     ./in.cue:137:12
  1582                       //     ./in.cue:138:32
  1583                       c: (int){ 1 }
  1584                       d: (int){ 1 }
  1585  @@ -249,38 +185,60 @@
  1586             }, (#struct){
  1587               a: (string){ string }
  1588               d: (string){ string }
  1589  -          }) }
  1590  -        #B: (#struct){ |(*(#struct){
  1591  -          }, (#struct){
  1592  -            c: (int){ int }
  1593  -          }, (#struct){
  1594  -            d: (string){ string }
  1595  -          }, (#struct){
  1596  -            a: (string){ string }
  1597  -          }, (#struct){
  1598  -            a: (string){ string }
  1599  -            c: (int){ int }
  1600  -          }, (#struct){
  1601  -            a: (string){ string }
  1602  -            d: (string){ string }
  1603  -          }, (#struct){
  1604  -            b: (string){ string }
  1605  -          }, (#struct){
  1606  -            b: (string){ string }
  1607  -            c: (int){ int }
  1608  -          }, (#struct){
  1609  -            b: (string){ string }
  1610  -            d: (string){ string }
  1611  -          }) }
  1612  -      }
  1613  -      p2: (struct){
  1614  -        #A: (#struct){ |(*(#struct){
  1615  -            a: (string){ string }
  1616  -          }, (#struct){
  1617  -            a: (string){ string }
  1618  -            c: (int){ int }
  1619  -          }, (#struct){
  1620  -            a: (string){ string }
  1621  +          }, (#struct){
  1622  +            a: (string){ string }
  1623  +            b: (string){ string }
  1624  +          }, (#struct){
  1625  +            a: (string){ string }
  1626  +            b: (string){ string }
  1627  +            c: (int){ int }
  1628  +          }, (#struct){
  1629  +            a: (string){ string }
  1630  +            b: (string){ string }
  1631  +            d: (string){ string }
  1632  +          }) }
  1633  +        #B: (#struct){ |(*(#struct){
  1634  +          }, (#struct){
  1635  +            c: (int){ int }
  1636  +          }, (#struct){
  1637  +            d: (string){ string }
  1638  +          }, (#struct){
  1639  +            a: (string){ string }
  1640  +          }, (#struct){
  1641  +            a: (string){ string }
  1642  +            c: (int){ int }
  1643  +          }, (#struct){
  1644  +            a: (string){ string }
  1645  +            d: (string){ string }
  1646  +          }, (#struct){
  1647  +            b: (string){ string }
  1648  +          }, (#struct){
  1649  +            b: (string){ string }
  1650  +            c: (int){ int }
  1651  +          }, (#struct){
  1652  +            b: (string){ string }
  1653  +            d: (string){ string }
  1654  +          }) }
  1655  +      }
  1656  +      p2: (struct){
  1657  +        #A: (#struct){ |(*(#struct){
  1658  +            a: (string){ string }
  1659  +          }, (#struct){
  1660  +            a: (string){ string }
  1661  +            c: (int){ int }
  1662  +          }, (#struct){
  1663  +            a: (string){ string }
  1664  +            d: (string){ string }
  1665  +          }, (#struct){
  1666  +            a: (string){ string }
  1667  +            b: (string){ string }
  1668  +          }, (#struct){
  1669  +            a: (string){ string }
  1670  +            b: (string){ string }
  1671  +            c: (int){ int }
  1672  +          }, (#struct){
  1673  +            a: (string){ string }
  1674  +            b: (string){ string }
  1675               d: (string){ string }
  1676             }) }
  1677           #B: (#struct){ |(*(#struct){
  1678  @@ -315,6 +273,17 @@
  1679             }, (#struct){
  1680               a: (string){ string }
  1681               d: (string){ string }
  1682  +          }, (#struct){
  1683  +            a: (string){ string }
  1684  +            b: (string){ string }
  1685  +          }, (#struct){
  1686  +            a: (string){ string }
  1687  +            b: (string){ string }
  1688  +            c: (int){ int }
  1689  +          }, (#struct){
  1690  +            a: (string){ string }
  1691  +            b: (string){ string }
  1692  +            d: (string){ string }
  1693             }) }
  1694           #B: (#struct){ |(*(#struct){
  1695             }, (#struct){
  1696  @@ -349,10 +318,6 @@
  1697         #type: (#struct){
  1698           fieldName: ((string|struct)){ |((string){ string }, (#struct){
  1699               foo: (string){ string }
  1700  -          }, (#struct){
  1701  -            bar: ((string|struct)){ |((string){ string }, (#struct){
  1702  -                foo: (string){ string }
  1703  -              }) }
  1704             }) }
  1705         }
  1706         #subtype: ((string|struct)){ |((string){ string }, (#struct){
  1707  @@ -386,9 +351,12 @@
  1708         }
  1709       }
  1710       t4: (struct){
  1711  -      o: (#struct){
  1712  -        b: (string){ "test" }
  1713  -      }
  1714  +      o: (#struct){ |((#struct){
  1715  +          b: (string){ "test" }
  1716  +          a: (null){ null }
  1717  +        }, (#struct){
  1718  +          b: (string){ "test" }
  1719  +        }) }
  1720         #D: (#struct){ |((#struct){
  1721             a: (null){ null }
  1722           }, (#struct){
  1723  @@ -432,12 +400,8 @@
  1724       #T: (list){
  1725         0: (string){ "d" }
  1726       }
  1727  -    x: (list){
  1728  -      0: (string){ "d" }
  1729  -    }
  1730  -    #X: (list){
  1731  -      0: (string){ "d" }
  1732  -    }
  1733  +    x: ~(noHang.#T)
  1734  +    #X: ~(noHang.#T)
  1735     }
  1736     issue1940: (struct){
  1737       #T: (#list){
  1738  @@ -446,53 +410,26 @@
  1739         }
  1740       }
  1741       #A: (#struct){
  1742  -      type: (#list){
  1743  -        0: (string){ "d" }
  1744  -        1: (list){
  1745  -        }
  1746  -      }
  1747  +      type: ~(issue1940.#T)
  1748       }
  1749       #B: (#struct){
  1750       }
  1751       #C: (#struct){
  1752         x: (#struct){
  1753  -        type: (#list){
  1754  -          0: (string){ "d" }
  1755  -          1: (list){
  1756  -          }
  1757  -        }
  1758  -      }
  1759  -    }
  1760  -  }
  1761  -  issue1417: (_|_){
  1762  -    // [eval]
  1763  +        type: ~(issue1940.#T)
  1764  +      }
  1765  +    }
  1766  +  }
  1767  +  issue1417: (struct){
  1768       #ID: (string){ |((string){ &(!~"^a", =~"^a") }, (string){ &(!~"^a", !~"[A-Z]") }, (string){ &(=~"^ab$", =~"^a") }, (string){ &(=~"^ab$", !~"[A-Z]") }, (string){ &(=~"^aB$", =~"^a") }, (string){ &(=~"^aB$", !~"[A-Z]") }) }
  1769  -    ids: (_|_){
  1770  -      // [eval]
  1771  +    ids: (#list){
  1772         0: (string){ "xyz" }
  1773  -      1: (_|_){
  1774  -        // [eval] issue1417.ids.1: invalid value "ab" (out of bound !~"^a"):
  1775  -        //     ./issue1417.cue:2:7
  1776  -        //     ./issue1417.cue:4:11
  1777  -        //     ./issue1417.cue:4:26
  1778  -      }
  1779  -      2: (_|_){
  1780  -        // [eval] issue1417.ids.2: 2 errors in empty disjunction:
  1781  -        // issue1417.ids.2: invalid value "aB" (out of bound !~"^a"):
  1782  -        //     ./issue1417.cue:2:7
  1783  -        //     ./issue1417.cue:4:11
  1784  -        //     ./issue1417.cue:4:32
  1785  -        // issue1417.ids.2: invalid value "aB" (out of bound !~"[A-Z]"):
  1786  -        //     ./issue1417.cue:3:16
  1787  -        //     ./issue1417.cue:4:11
  1788  -        //     ./issue1417.cue:4:32
  1789  -      }
  1790  -    }
  1791  -  }
  1792  -  issue2209: (_|_){
  1793  -    // [eval]
  1794  -    simplified: (_|_){
  1795  -      // [eval]
  1796  +      1: (string){ "ab" }
  1797  +      2: (string){ "aB" }
  1798  +    }
  1799  +  }
  1800  +  issue2209: (struct){
  1801  +    simplified: (struct){
  1802         t1: (struct){
  1803           #SpecFoo: (#struct){
  1804             foo: (#struct){
  1805  @@ -555,185 +492,118 @@
  1806               x: (int){ 1 }
  1807             }
  1808           }
  1809  -        spec: (#struct){ |(*(#struct){
  1810  -            bar: (struct){
  1811  -            }
  1812  -            foo: (#struct){
  1813  -            }
  1814  -          }, (#struct){
  1815  -            bar: (#struct){
  1816  -              x: (int){ 1 }
  1817  -            }
  1818  -          }) }
  1819  -        BAZ: (_|_){
  1820  -          // [incomplete] issue2209.simplified.t2.BAZ: undefined field: x:
  1821  -          //     ./issue2209full.cue:24:17
  1822  -        }
  1823  -        b2: (int){ int }
  1824  -      }
  1825  -      t3: (_|_){
  1826  -        // [eval] issue2209.simplified.t3.BAZ: undefined field: y:
  1827  -        //     ./issue2209full.cue:35:9
  1828  -        #A: (#struct){
  1829  -          v: (int){ 1 }
  1830  -        }
  1831  -        BAZ: (_|_){
  1832  -          // [eval] issue2209.simplified.t3.BAZ: undefined field: y:
  1833  -          //     ./issue2209full.cue:35:9
  1834  -        }
  1835  -        S: (#struct){ |(*(#struct){
  1836  -            x: (int){ 1 }
  1837  -            v: (int){ 1 }
  1838  -          }, (#struct){
  1839  -            x: (int){ 1 }
  1840  -            y: (int){ 1 }
  1841  -          }) }
  1842  -        #B: (#struct){
  1843  -          x: (int){ 1 }
  1844  -          y: (int){ 1 }
  1845  -        }
  1846  -        b2: (int){ int }
  1847  -      }
  1848  -    }
  1849  -    full: (_|_){
  1850  -      // [eval]
  1851  +        spec: (struct){
  1852  +          bar: (struct){
  1853  +          }
  1854  +        }
  1855  +        BAZ: (_){ _ }
  1856  +      }
  1857  +      t3: (struct){ |((struct){
  1858  +          #A: (#struct){
  1859  +            v: (int){ 1 }
  1860  +          }
  1861  +          BAZ: (_){ _ }
  1862  +          S: (#struct){
  1863  +            x: (int){ 1 }
  1864  +            y: (int){ 1 }
  1865  +          }
  1866  +          #B: (#struct){
  1867  +            x: (int){ 1 }
  1868  +            y: (int){ 1 }
  1869  +          }
  1870  +          f1: (int){ int }
  1871  +          f2: (int){ int }
  1872  +        }, (struct){
  1873  +          #A: (#struct){
  1874  +            v: (int){ 1 }
  1875  +          }
  1876  +          BAZ: (_){ _ }
  1877  +          S: (#struct){
  1878  +            x: (int){ 1 }
  1879  +            y: (int){ 1 }
  1880  +          }
  1881  +          #B: (#struct){
  1882  +            x: (int){ 1 }
  1883  +            y: (int){ 1 }
  1884  +          }
  1885  +          f1: (int){ int }
  1886  +          b2: (int){ int }
  1887  +        }) }
  1888  +    }
  1889  +    full: (struct){
  1890         Foo: (#struct){
  1891  -        spec: (#struct){
  1892  -          foo: (#struct){
  1893  -            min: (int){ |(*(int){ 10 }, (int){ int }) }
  1894  -            max: (int){ |(*(int){ 20 }, (int){ int }) }
  1895  -          }
  1896  -        }
  1897  -        resource: (#struct){
  1898  -          spec: (#struct){ |(*(#struct){
  1899  -              minFoo: (int){ |(*(int){ 10 }, (int){ int }) }
  1900  -              maxFoo: (int){ |(*(int){ 20 }, (int){ int }) }
  1901  -              minBar?: (null){ null }
  1902  -              maxBar?: (null){ null }
  1903  -              hoge?: ((null|bool)){ |((null){ null }, (bool){ bool }) }
  1904  -              fuga?: (null){ null }
  1905  -            }, (#struct){
  1906  -              minFoo: (int){ |(*(int){ 10 }, (int){ int }) }
  1907  -              maxFoo: (int){ |(*(int){ 20 }, (int){ int }) }
  1908  -              minBar?: (null){ null }
  1909  -              maxBar?: (null){ null }
  1910  -              hoge?: (null){ null }
  1911  -              fuga?: ((null|bool)){ |((null){ null }, (bool){ bool }) }
  1912  -            }) }
  1913  -          _X: (#struct){
  1914  -            spec: (#struct){ |(*(#struct){
  1915  -                foo: (#struct){
  1916  -                  min: (int){ |(*(int){ 10 }, (int){ int }) }
  1917  -                  max: (int){ |(*(int){ 20 }, (int){ int }) }
  1918  -                }
  1919  -              }, (#struct){
  1920  -                foo: (#struct){
  1921  -                }
  1922  -                bar: (#struct){
  1923  -                  min: (int){ |(*(int){ 30 }, (int){ int }) }
  1924  -                  max: (int){ |(*(int){ 40 }, (int){ int }) }
  1925  -                }
  1926  -              }) }
  1927  -          }
  1928  -        }
  1929  -      }
  1930  -      Bar: (_|_){
  1931  -        // [eval]
  1932  -        spec: (#struct){
  1933  -          bar: (#struct){
  1934  -            min: (int){ |(*(int){ 30 }, (int){ int }) }
  1935  -            max: (int){ |(*(int){ 40 }, (int){ int }) }
  1936  -          }
  1937  -        }
  1938  -        resource: (_|_){
  1939  -          // [eval]
  1940  -          spec: (_|_){
  1941  -            // [eval] issue2209.full.Bar.resource.spec: 6 errors in empty disjunction:
  1942  -            // issue2209.full.Bar.resource.spec.minBar: 2 errors in empty disjunction:
  1943  -            // issue2209.full.Bar.resource.spec.minBar: conflicting values null and int (mismatched types null and int):
  1944  -            //     ./issue2209full.cue:43:7
  1945  -            //     ./issue2209full.cue:48:13
  1946  -            //     ./issue2209full.cue:67:10
  1947  -            //     ./issue2209full.cue:83:16
  1948  -            //     ./issue2209full.cue:87:13
  1949  -            //     ./issue2209full.cue:107:20
  1950  -            // issue2209.full.Bar.resource.spec.minFoo: 2 errors in empty disjunction:
  1951  -            // issue2209.full.Bar.resource.spec.minFoo: conflicting values null and 10 (mismatched types null and int):
  1952  -            //     ./issue2209full.cue:43:7
  1953  -            //     ./issue2209full.cue:48:13
  1954  -            //     ./issue2209full.cue:55:16
  1955  -            //     ./issue2209full.cue:71:4
  1956  -            //     ./issue2209full.cue:72:13
  1957  -            //     ./issue2209full.cue:92:13
  1958  -            // issue2209.full.Bar.resource.spec.minFoo: conflicting values null and int (mismatched types null and int):
  1959  -            //     ./issue2209full.cue:43:7
  1960  -            //     ./issue2209full.cue:48:13
  1961  -            //     ./issue2209full.cue:67:10
  1962  -            //     ./issue2209full.cue:83:16
  1963  -            //     ./issue2209full.cue:92:13
  1964  -            //     ./issue2209full.cue:105:20
  1965  -            // issue2209.full.Bar.resource.spec.minBar: undefined field: min:
  1966  -            //     ./issue2209full.cue:77:25
  1967  -            minFoo: (_|_){
  1968  -              // [eval] issue2209.full.Bar.resource.spec.minFoo: 2 errors in empty disjunction:
  1969  -              // issue2209.full.Bar.resource.spec.minFoo: conflicting values null and 10 (mismatched types null and int):
  1970  -              //     ./issue2209full.cue:43:7
  1971  -              //     ./issue2209full.cue:48:13
  1972  -              //     ./issue2209full.cue:55:16
  1973  -              //     ./issue2209full.cue:71:4
  1974  -              //     ./issue2209full.cue:72:13
  1975  -              //     ./issue2209full.cue:92:13
  1976  -              // issue2209.full.Bar.resource.spec.minFoo: conflicting values null and int (mismatched types null and int):
  1977  -              //     ./issue2209full.cue:43:7
  1978  -              //     ./issue2209full.cue:48:13
  1979  -              //     ./issue2209full.cue:67:10
  1980  -              //     ./issue2209full.cue:83:16
  1981  -              //     ./issue2209full.cue:92:13
  1982  -              //     ./issue2209full.cue:105:20
  1983  -            }
  1984  -            maxFoo: (_|_){
  1985  -              // [eval] issue2209.full.Bar.resource.spec.maxFoo: 2 errors in empty disjunction:
  1986  -              // issue2209.full.Bar.resource.spec.maxFoo: conflicting values null and 20 (mismatched types null and int):
  1987  -              //     ./issue2209full.cue:43:7
  1988  -              //     ./issue2209full.cue:48:13
  1989  -              //     ./issue2209full.cue:56:16
  1990  -              //     ./issue2209full.cue:71:4
  1991  -              //     ./issue2209full.cue:73:13
  1992  -              //     ./issue2209full.cue:93:13
  1993  -              // issue2209.full.Bar.resource.spec.maxFoo: conflicting values null and int (mismatched types null and int):
  1994  -              //     ./issue2209full.cue:43:7
  1995  -              //     ./issue2209full.cue:48:13
  1996  -              //     ./issue2209full.cue:67:10
  1997  -              //     ./issue2209full.cue:83:16
  1998  -              //     ./issue2209full.cue:93:13
  1999  -              //     ./issue2209full.cue:106:20
  2000  -            }
  2001  -            minBar: (_|_){
  2002  -              // [eval] issue2209.full.Bar.resource.spec.minBar: undefined field: min:
  2003  -              //     ./issue2209full.cue:77:25
  2004  -            }
  2005  -            maxBar: (_|_){
  2006  -              // [eval] issue2209.full.Bar.resource.spec.maxBar: undefined field: max:
  2007  -              //     ./issue2209full.cue:78:25
  2008  -            }
  2009  -            hoge?: ((null|bool)){ |((null){ null }, (bool){ bool }) }
  2010  -            fuga?: ((null|bool)){ |((null){ null }, (bool){ bool }) }
  2011  -          }
  2012  -          _X: (#struct){
  2013  -            spec: (#struct){ |(*(#struct){
  2014  -                bar: (#struct){
  2015  -                }
  2016  -                foo: (#struct){
  2017  -                  min: (int){ |(*(int){ 10 }, (int){ int }) }
  2018  -                  max: (int){ |(*(int){ 20 }, (int){ int }) }
  2019  -                }
  2020  -              }, (#struct){
  2021  -                bar: (#struct){
  2022  -                  min: (int){ |(*(int){ 30 }, (int){ int }) }
  2023  -                  max: (int){ |(*(int){ 40 }, (int){ int }) }
  2024  -                }
  2025  -              }) }
  2026  -          }
  2027  +        spec: (#struct){ |(*(#struct){
  2028  +            foo: (#struct){
  2029  +              min: (int){ |(*(int){ 10 }, (int){ int }) }
  2030  +              max: (int){ |(*(int){ 20 }, (int){ int }) }
  2031  +            }
  2032  +          }, (#struct){
  2033  +            foo: (struct){
  2034  +            }
  2035  +            bar: (#struct){
  2036  +              min: (int){ |(*(int){ 30 }, (int){ int }) }
  2037  +              max: (int){ |(*(int){ 40 }, (int){ int }) }
  2038  +            }
  2039  +          }) }
  2040  +        resource: (#struct){
  2041  +          _X: (#struct){
  2042  +            spec: (#struct){ |(*(#struct){
  2043  +                foo: (#struct){
  2044  +                  min: (int){ |(*(int){ 10 }, (int){ int }) }
  2045  +                  max: (int){ |(*(int){ 20 }, (int){ int }) }
  2046  +                }
  2047  +              }, (#struct){
  2048  +                foo: (struct){
  2049  +                }
  2050  +                bar: (#struct){
  2051  +                  min: (int){ |(*(int){ 30 }, (int){ int }) }
  2052  +                  max: (int){ |(*(int){ 40 }, (int){ int }) }
  2053  +                }
  2054  +              }) }
  2055  +          }
  2056  +          spec: (#struct){ |(*(#struct){
  2057  +              minFoo: (int){ |(*(int){ 10 }, (int){ int }) }
  2058  +              maxFoo: (int){ |(*(int){ 20 }, (int){ int }) }
  2059  +              minBar?: (null){ null }
  2060  +              maxBar?: (null){ null }
  2061  +              hoge?: ((null|bool)){ |((null){ null }, (bool){ bool }) }
  2062  +              fuga?: (null){ null }
  2063  +            }, (#struct){
  2064  +              minFoo: (int){ |(*(int){ 10 }, (int){ int }) }
  2065  +              maxFoo: (int){ |(*(int){ 20 }, (int){ int }) }
  2066  +              minBar?: (null){ null }
  2067  +              maxBar?: (null){ null }
  2068  +              hoge?: (null){ null }
  2069  +              fuga?: ((null|bool)){ |((null){ null }, (bool){ bool }) }
  2070  +            }) }
  2071  +        }
  2072  +      }
  2073  +      Bar: (#struct){
  2074  +        spec: (#struct){
  2075  +          bar: (#struct){
  2076  +            min: (int){ |(*(int){ 30 }, (int){ int }) }
  2077  +            max: (int){ |(*(int){ 40 }, (int){ int }) }
  2078  +          }
  2079  +        }
  2080  +        resource: (#struct){
  2081  +          _X: (#struct){
  2082  +            spec: ~(issue2209.full.Bar.spec)
  2083  +          }
  2084  +          spec: (#struct){ |(*(#struct){
  2085  +              minFoo?: (null){ null }
  2086  +              maxFoo?: (null){ null }
  2087  +              minBar: (int){ |(*(int){ 30 }, (int){ int }) }
  2088  +              maxBar: (int){ |(*(int){ 40 }, (int){ int }) }
  2089  +              hoge?: ((null|bool)){ |((null){ null }, (bool){ bool }) }
  2090  +              fuga?: (null){ null }
  2091  +            }, (#struct){
  2092  +              minFoo?: (null){ null }
  2093  +              maxFoo?: (null){ null }
  2094  +              minBar: (int){ |(*(int){ 30 }, (int){ int }) }
  2095  +              maxBar: (int){ |(*(int){ 40 }, (int){ int }) }
  2096  +              hoge?: (null){ null }
  2097  +              fuga?: ((null|bool)){ |((null){ null }, (bool){ bool }) }
  2098  +            }) }
  2099           }
  2100         }
  2101         #Abstract: (#struct){
  2102  @@ -749,34 +619,34 @@
  2103               }
  2104             }) }
  2105           resource: (#struct){
  2106  -          spec: (#struct){ |(*(#struct){
  2107  -              minFoo: (int){ |(*(int){ 10 }, (int){ int }) }
  2108  -              maxFoo: (int){ |(*(int){ 20 }, (int){ int }) }
  2109  -              minBar?: (null){ null }
  2110  -              maxBar?: (null){ null }
  2111  -              hoge?: ((null|bool)){ |((null){ null }, (bool){ bool }) }
  2112  -              fuga?: (null){ null }
  2113  -            }, (#struct){
  2114  -              minFoo: (int){ |(*(int){ 10 }, (int){ int }) }
  2115  -              maxFoo: (int){ |(*(int){ 20 }, (int){ int }) }
  2116  -              minBar?: (null){ null }
  2117  -              maxBar?: (null){ null }
  2118  -              hoge?: (null){ null }
  2119  -              fuga?: ((null|bool)){ |((null){ null }, (bool){ bool }) }
  2120  -            }) }
  2121  -          _X: (#struct){
  2122  -            spec: (#struct){ |(*(#struct){
  2123  -                foo: (#struct){
  2124  -                  min: (int){ |(*(int){ 10 }, (int){ int }) }
  2125  -                  max: (int){ |(*(int){ 20 }, (int){ int }) }
  2126  -                }
  2127  -              }, (#struct){
  2128  -                bar: (#struct){
  2129  -                  min: (int){ |(*(int){ 30 }, (int){ int }) }
  2130  -                  max: (int){ |(*(int){ 40 }, (int){ int }) }
  2131  -                }
  2132  -              }) }
  2133  -          }
  2134  +          _X: (#struct){
  2135  +            spec: (#struct){ |(*(#struct){
  2136  +                foo: (#struct){
  2137  +                  min: (int){ |(*(int){ 10 }, (int){ int }) }
  2138  +                  max: (int){ |(*(int){ 20 }, (int){ int }) }
  2139  +                }
  2140  +              }, (#struct){
  2141  +                bar: (#struct){
  2142  +                  min: (int){ |(*(int){ 30 }, (int){ int }) }
  2143  +                  max: (int){ |(*(int){ 40 }, (int){ int }) }
  2144  +                }
  2145  +              }) }
  2146  +          }
  2147  +          spec: (#struct){ |(*(#struct){
  2148  +              minFoo: (int){ |(*(int){ 10 }, (int){ int }) }
  2149  +              maxFoo: (int){ |(*(int){ 20 }, (int){ int }) }
  2150  +              minBar?: (null){ null }
  2151  +              maxBar?: (null){ null }
  2152  +              hoge?: ((null|bool)){ |((null){ null }, (bool){ bool }) }
  2153  +              fuga?: (null){ null }
  2154  +            }, (#struct){
  2155  +              minFoo: (int){ |(*(int){ 10 }, (int){ int }) }
  2156  +              maxFoo: (int){ |(*(int){ 20 }, (int){ int }) }
  2157  +              minBar?: (null){ null }
  2158  +              maxBar?: (null){ null }
  2159  +              hoge?: (null){ null }
  2160  +              fuga?: ((null|bool)){ |((null){ null }, (bool){ bool }) }
  2161  +            }) }
  2162           }
  2163         }
  2164         _#Spec: (#struct){ |(*(#struct){
  2165  @@ -803,36 +673,36 @@
  2166           }
  2167         }
  2168         _Thing: (#struct){
  2169  -        spec: (#struct){ |(*(#struct){
  2170  -            minFoo: (int){ |(*(int){ 10 }, (int){ int }) }
  2171  -            maxFoo: (int){ |(*(int){ 20 }, (int){ int }) }
  2172  -            minBar?: (null){ null }
  2173  -            maxBar?: (null){ null }
  2174  -            hoge?: ((null|bool)){ |((null){ null }, (bool){ bool }) }
  2175  -            fuga?: (null){ null }
  2176  -          }, *(#struct){
  2177  -            minFoo?: (null){ null }
  2178  -            maxFoo?: (null){ null }
  2179  -            minBar: (int){ |(*(int){ 30 }, (int){ int }) }
  2180  -            maxBar: (int){ |(*(int){ 40 }, (int){ int }) }
  2181  -            hoge?: ((null|bool)){ |((null){ null }, (bool){ bool }) }
  2182  -            fuga?: (null){ null }
  2183  -          }, (#struct){
  2184  -            minFoo: (int){ |(*(int){ 10 }, (int){ int }) }
  2185  -            maxFoo: (int){ |(*(int){ 20 }, (int){ int }) }
  2186  -            minBar?: (null){ null }
  2187  -            maxBar?: (null){ null }
  2188  -            hoge?: (null){ null }
  2189  -            fuga?: ((null|bool)){ |((null){ null }, (bool){ bool }) }
  2190  -          }, (#struct){
  2191  -            minFoo?: (null){ null }
  2192  -            maxFoo?: (null){ null }
  2193  -            minBar: (int){ |(*(int){ 30 }, (int){ int }) }
  2194  -            maxBar: (int){ |(*(int){ 40 }, (int){ int }) }
  2195  -            hoge?: (null){ null }
  2196  -            fuga?: ((null|bool)){ |((null){ null }, (bool){ bool }) }
  2197  -          }) }
  2198           _X: (_){ _ }
  2199  +        spec: (#struct){ |(*(#struct){
  2200  +            minFoo: (int){ |(*(int){ 10 }, (int){ int }) }
  2201  +            maxFoo: (int){ |(*(int){ 20 }, (int){ int }) }
  2202  +            minBar?: (null){ null }
  2203  +            maxBar?: (null){ null }
  2204  +            hoge?: ((null|bool)){ |((null){ null }, (bool){ bool }) }
  2205  +            fuga?: (null){ null }
  2206  +          }, *(#struct){
  2207  +            minFoo?: (null){ null }
  2208  +            maxFoo?: (null){ null }
  2209  +            minBar: (int){ |(*(int){ 30 }, (int){ int }) }
  2210  +            maxBar: (int){ |(*(int){ 40 }, (int){ int }) }
  2211  +            hoge?: ((null|bool)){ |((null){ null }, (bool){ bool }) }
  2212  +            fuga?: (null){ null }
  2213  +          }, (#struct){
  2214  +            minFoo: (int){ |(*(int){ 10 }, (int){ int }) }
  2215  +            maxFoo: (int){ |(*(int){ 20 }, (int){ int }) }
  2216  +            minBar?: (null){ null }
  2217  +            maxBar?: (null){ null }
  2218  +            hoge?: (null){ null }
  2219  +            fuga?: ((null|bool)){ |((null){ null }, (bool){ bool }) }
  2220  +          }, (#struct){
  2221  +            minFoo?: (null){ null }
  2222  +            maxFoo?: (null){ null }
  2223  +            minBar: (int){ |(*(int){ 30 }, (int){ int }) }
  2224  +            maxBar: (int){ |(*(int){ 40 }, (int){ int }) }
  2225  +            hoge?: (null){ null }
  2226  +            fuga?: ((null|bool)){ |((null){ null }, (bool){ bool }) }
  2227  +          }) }
  2228         }
  2229         #Constrained: (#struct){
  2230           spec: (#struct){ |(*(#struct){
  2231  @@ -916,19 +786,19 @@
  2232             common: (int){ 3 }
  2233           }
  2234           #FormFoo: (#struct){
  2235  -          common: (int){ 3 }
  2236  -          fooID: (string){ string }
  2237  +          fooID: (string){ string }
  2238  +          common: (int){ 3 }
  2239           }
  2240           #FormBar: (#struct){
  2241  -          common: (int){ 3 }
  2242  -          barID: (string){ string }
  2243  +          barID: (string){ string }
  2244  +          common: (int){ 3 }
  2245           }
  2246           #Form: (#struct){ |((#struct){
  2247  -            common: (int){ 3 }
  2248               fooID: (string){ string }
  2249  -          }, (#struct){
  2250  -            common: (int){ 3 }
  2251  +            common: (int){ 3 }
  2252  +          }, (#struct){
  2253               barID: (string){ string }
  2254  +            common: (int){ 3 }
  2255             }) }
  2256         }
  2257         #Input: (#struct){
  2258  @@ -977,10 +847,23 @@
  2259       }
  2260       full: (struct){
  2261         metrics: (#list){
  2262  -        0: (#struct){
  2263  -          id: (string){ "foo" }
  2264  -          avg: (int){ 60 }
  2265  -        }
  2266  +        0: (#struct){ |((#struct){
  2267  +            id: (string){ "foo" }
  2268  +            avg: (int){ 60 }
  2269  +          }, (#struct){
  2270  +            id: (string){ "foo" }
  2271  +            avg: (int){ 60 }
  2272  +            value: (number){ number }
  2273  +          }, (#struct){
  2274  +            id: (string){ "foo" }
  2275  +            avg: (int){ 60 }
  2276  +            uri: (string){ string }
  2277  +          }, (#struct){
  2278  +            id: (string){ "foo" }
  2279  +            avg: (int){ 60 }
  2280  +            uri: (string){ string }
  2281  +            value: (number){ number }
  2282  +          }) }
  2283           1: (#struct){
  2284             id: (string){ "bar" }
  2285             value: (int){ 80 }
  2286  @@ -1031,13 +914,11 @@
  2287         }
  2288       }
  2289     }
  2290  -  issue3149: (_|_){
  2291  -    // [eval]
  2292  +  issue3149: (struct){
  2293       #valid: (#struct){
  2294         name!: (string){ |((string){ &(=~"^Foo", =~"Foo$") }, (string){ "an exception" }) }
  2295       }
  2296  -    list: (_|_){
  2297  -      // [eval]
  2298  +    list: (#list){
  2299         0: (#struct){
  2300           name: (string){ "FooBarFoo" }
  2301         }
  2302  @@ -1047,19 +928,8 @@
  2303         2: (#struct){
  2304           name: (string){ "FooQuuxFoo" }
  2305         }
  2306  -      3: (_|_){
  2307  -        // [eval]
  2308  -        name: (_|_){
  2309  -          // [eval] issue3149.list.3.name: 2 errors in empty disjunction:
  2310  -          // issue3149.list.3.name: invalid value "an exception" (out of bound =~"^Foo"):
  2311  -          //     ./issue3149.cue:3:13
  2312  -          //     ./issue3149.cue:3:10
  2313  -          //     ./issue3149.cue:10:10
  2314  -          // issue3149.list.3.name: invalid value "an exception" (out of bound =~"Foo$"):
  2315  -          //     ./issue3149.cue:3:46
  2316  -          //     ./issue3149.cue:3:10
  2317  -          //     ./issue3149.cue:10:10
  2318  -        }
  2319  +      3: (#struct){
  2320  +        name: (string){ "an exception" }
  2321         }
  2322       }
  2323     }
  2324  @@ -1078,10 +948,10 @@
  2325           v: (string){ |(*(string){ "a" }, (string){ "b" }, (string){ "c" }) }
  2326         }
  2327         c: (#struct){
  2328  -        v: (string){ |(*(string){ "a" }, *(string){ "b" }, *(string){ "c" }) }
  2329  +        v: (string){ |(*(string){ "a" }, (string){ "b" }, (string){ "c" }) }
  2330         }
  2331         coo: (#struct){
  2332  -        v: (string){ |(*(string){ "a" }, *(string){ "b" }, *(string){ "c" }) }
  2333  +        v: (string){ |(*(string){ "a" }, (string){ "b" }, (string){ "c" }) }
  2334         }
  2335       }
  2336     }
  2337  -- out/eval/stats --
  2338  Leaks:  4
  2339  Freed:  2554
  2340  Reused: 2538
  2341  Allocs: 20
  2342  Retain: 115
  2343  
  2344  Unifications: 1292
  2345  Conjuncts:    3726
  2346  Disjuncts:    2669
  2347  -- diff/todo/p1 --
  2348  issue2263.full: missing elimination, may be lack of closeContext
  2349  -- diff/todo/p2 --
  2350  noChildError.issue1808.#type: one disjunction options eliminated due to earlier detected structural cycle. May be okay, but investigate.
  2351  issue2209.simplified.full._X: ditto
  2352  preserveClosedness.medium.p*: missing elimination of disjuncts / needs default elimination.
  2353  -- diff/todo/p3 --
  2354  issue2209.simplified.t2.BAZ: error reported in wrong location.
  2355  -- diff/explanation --
  2356  issue2209.simplified.t3: new evaluator fixes known bug.
  2357  preserveClosedness.medium.p*: discarding of default is correct.
  2358  issue1417: new evaluator fixes known bug
  2359  issue3149: new evaluator fixes known bug
  2360  issue770: new evaluator fixes a bug in "c" and "coo" where defaults did not apply correctly.
  2361  -- out/eval --
  2362  Errors:
  2363  issue1417.ids.2: 2 errors in empty disjunction:
  2364  issue2209.full.Bar.resource.spec: 6 errors in empty disjunction:
  2365  issue2209.full.Bar.resource.spec.minBar: 2 errors in empty disjunction:
  2366  issue2209.full.Bar.resource.spec.minBar: conflicting values null and int (mismatched types null and int):
  2367      ./issue2209full.cue:43:7
  2368      ./issue2209full.cue:48:13
  2369      ./issue2209full.cue:67:10
  2370      ./issue2209full.cue:83:16
  2371      ./issue2209full.cue:87:13
  2372      ./issue2209full.cue:107:20
  2373  issue2209.full.Bar.resource.spec.minFoo: 2 errors in empty disjunction:
  2374  issue2209.full.Bar.resource.spec.minFoo: conflicting values null and 10 (mismatched types null and int):
  2375      ./issue2209full.cue:43:7
  2376      ./issue2209full.cue:48:13
  2377      ./issue2209full.cue:55:16
  2378      ./issue2209full.cue:71:4
  2379      ./issue2209full.cue:72:13
  2380      ./issue2209full.cue:92:13
  2381  issue2209.full.Bar.resource.spec.minFoo: conflicting values null and int (mismatched types null and int):
  2382      ./issue2209full.cue:43:7
  2383      ./issue2209full.cue:48:13
  2384      ./issue2209full.cue:67:10
  2385      ./issue2209full.cue:83:16
  2386      ./issue2209full.cue:92:13
  2387      ./issue2209full.cue:105:20
  2388  issue3149.list.3.name: 2 errors in empty disjunction:
  2389  issue1417.ids.1: invalid value "ab" (out of bound !~"^a"):
  2390      ./issue1417.cue:2:7
  2391      ./issue1417.cue:4:11
  2392      ./issue1417.cue:4:26
  2393  issue1417.ids.2: invalid value "aB" (out of bound !~"^a"):
  2394      ./issue1417.cue:2:7
  2395      ./issue1417.cue:4:11
  2396      ./issue1417.cue:4:32
  2397  issue1417.ids.2: invalid value "aB" (out of bound !~"[A-Z]"):
  2398      ./issue1417.cue:3:16
  2399      ./issue1417.cue:4:11
  2400      ./issue1417.cue:4:32
  2401  issue2209.simplified.t3.BAZ: undefined field: y:
  2402      ./issue2209full.cue:35:9
  2403  issue2209.full.Bar.resource.spec.minBar: undefined field: min:
  2404      ./issue2209full.cue:77:25
  2405  issue3149.list.3.name: invalid value "an exception" (out of bound =~"^Foo"):
  2406      ./issue3149.cue:3:13
  2407      ./issue3149.cue:3:10
  2408      ./issue3149.cue:10:10
  2409  issue3149.list.3.name: invalid value "an exception" (out of bound =~"Foo$"):
  2410      ./issue3149.cue:3:46
  2411      ./issue3149.cue:3:10
  2412      ./issue3149.cue:10:10
  2413  
  2414  Result:
  2415  (_|_){
  2416    // [eval]
  2417    disambiguateClosed: (struct){
  2418      b: (#struct){ |((#struct){
  2419          x: (bool){ true }
  2420        }, (#struct){
  2421          y: (bool){ true }
  2422        }) }
  2423      a: (#struct){ |((#struct){
  2424          x: (bool){ true }
  2425        }, (#struct){
  2426          y: (bool){ true }
  2427        }) }
  2428      #Def: (#struct){ |((#struct){
  2429          x: (bool){ true }
  2430        }, (#struct){
  2431          y: (bool){ true }
  2432        }) }
  2433    }
  2434    alwaysCheckMatchers1: (struct){
  2435      b: (struct){
  2436        c: (string){ "yyyyy" }
  2437      }
  2438    }
  2439    alwaysCheckPatterns2: (struct){
  2440      a: (#struct){
  2441        c: (string){ "yyyyy" }
  2442      }
  2443      b: (#struct){
  2444        c: (string){ "yyyyy" }
  2445      }
  2446      #X: ((string|struct)){ |((string){ string }, (#struct){
  2447          c: (string){ string }
  2448        }) }
  2449    }
  2450    nestedNonMonotonic: (struct){
  2451      resolved: (struct){
  2452        n1: (struct){
  2453          x: ((null|struct)){ |((struct){
  2454              a: (struct){
  2455                c: (int){ 1 }
  2456                d: (int){ 1 }
  2457              }
  2458            }, (null){ null }) }
  2459        }
  2460        n2: (struct){
  2461          x: ((null|struct)){ |((struct){
  2462              a: (struct){
  2463                b: (struct){
  2464                  c: (int){ 1 }
  2465                  d: (int){ 1 }
  2466                }
  2467              }
  2468            }, (null){ null }) }
  2469        }
  2470      }
  2471      eliminated: (struct){
  2472        n1: (struct){
  2473          p1: (struct){
  2474            x: (null){ null }
  2475          }
  2476          p2: (struct){
  2477            x: (null){ null }
  2478          }
  2479        }
  2480        n2: (struct){
  2481          p1: (struct){
  2482            x: (null){ null }
  2483          }
  2484          p2: (struct){
  2485            x: (null){ null }
  2486          }
  2487        }
  2488      }
  2489      incomplete: (struct){
  2490        a: (struct){
  2491          n1: (struct){
  2492            p1: (struct){
  2493              x: (null){ null }
  2494            }
  2495            p2: (struct){
  2496              x: (null){ null }
  2497            }
  2498          }
  2499          n2: (struct){
  2500            p1: (struct){
  2501              x: ((null|struct)){ |((struct){
  2502                  a: (struct){
  2503                    b: (_|_){
  2504                      // [incomplete] nestedNonMonotonic.incomplete.a.n2.p1.x.a.b: invalid value {c:1} (does not satisfy struct.MinFields(2)): len(fields) < MinFields(2) (1 < 2):
  2505                      //     ./in.cue:96:15
  2506                      //     ./in.cue:96:32
  2507                      //     ./in.cue:97:12
  2508                      c: (int){ 1 }
  2509                    }
  2510                  }
  2511                }, (null){ null }) }
  2512            }
  2513            p2: (struct){
  2514              x: ((null|struct)){ |((struct){
  2515                  a: (struct){
  2516                    b: (_|_){
  2517                      // [incomplete] nestedNonMonotonic.incomplete.a.n2.p2.x.a.b: invalid value {c:1} (does not satisfy struct.MinFields(2)): len(fields) < MinFields(2) (1 < 2):
  2518                      //     ./in.cue:102:15
  2519                      //     ./in.cue:101:12
  2520                      //     ./in.cue:102:32
  2521                      c: (int){ 1 }
  2522                    }
  2523                  }
  2524                }, (null){ null }) }
  2525            }
  2526          }
  2527        }
  2528        b: (struct){
  2529          n1: (struct){
  2530            p1: (struct){
  2531              x: (null){ null }
  2532            }
  2533            p2: (struct){
  2534              x: (null){ null }
  2535            }
  2536            p3: (struct){
  2537              x: (null){ null }
  2538            }
  2539          }
  2540          n2: (struct){
  2541            p1: (struct){
  2542              x: ((null|struct)){ |((struct){
  2543                  a: (struct){
  2544                    b: (_|_){
  2545                      // [incomplete] nestedNonMonotonic.incomplete.b.n2.p1.x.a.b: invalid value {c:1 & 1 & 1,d:1 & 1 & 1} (does not satisfy struct.MinFields(3)): len(fields) < MinFields(3) (2 < 3):
  2546                      //     ./in.cue:138:15
  2547                      //     ./in.cue:124:15
  2548                      //     ./in.cue:125:12
  2549                      //     ./in.cue:126:12
  2550                      //     ./in.cue:130:12
  2551                      //     ./in.cue:131:15
  2552                      //     ./in.cue:132:12
  2553                      //     ./in.cue:136:12
  2554                      //     ./in.cue:137:12
  2555                      //     ./in.cue:138:32
  2556                      c: (int){ 1 }
  2557                      d: (int){ 1 }
  2558                    }
  2559                  }
  2560                }, (null){ null }) }
  2561            }
  2562          }
  2563        }
  2564      }
  2565    }
  2566    preserveClosedness: (struct){
  2567      small: (struct){
  2568        p1: (struct){
  2569          #A: (#struct){ |(*(#struct){
  2570              a: (string){ string }
  2571            }, (#struct){
  2572              a: (string){ string }
  2573              b: (int){ int }
  2574            }) }
  2575          #B: (#struct){ |(*(#struct){
  2576            }, (#struct){
  2577              b: (int){ int }
  2578            }, (#struct){
  2579              a: (string){ string }
  2580            }, (#struct){
  2581              a: (string){ string }
  2582              b: (int){ int }
  2583            }) }
  2584        }
  2585        p2: (struct){
  2586          #A: (#struct){ |(*(#struct){
  2587              a: (string){ string }
  2588            }, (#struct){
  2589              a: (string){ string }
  2590              b: (int){ int }
  2591            }) }
  2592          #B: (#struct){ |(*(#struct){
  2593            }, (#struct){
  2594              a: (string){ string }
  2595              b: (int){ int }
  2596            }, (#struct){
  2597              a: (string){ string }
  2598            }, (#struct){
  2599              b: (int){ int }
  2600            }) }
  2601        }
  2602      }
  2603      medium: (struct){
  2604        p1: (struct){
  2605          #A: (#struct){ |(*(#struct){
  2606              a: (string){ string }
  2607            }, (#struct){
  2608              a: (string){ string }
  2609              c: (int){ int }
  2610            }, (#struct){
  2611              a: (string){ string }
  2612              d: (string){ string }
  2613            }) }
  2614          #B: (#struct){ |(*(#struct){
  2615            }, (#struct){
  2616              c: (int){ int }
  2617            }, (#struct){
  2618              d: (string){ string }
  2619            }, (#struct){
  2620              a: (string){ string }
  2621            }, (#struct){
  2622              a: (string){ string }
  2623              c: (int){ int }
  2624            }, (#struct){
  2625              a: (string){ string }
  2626              d: (string){ string }
  2627            }, (#struct){
  2628              b: (string){ string }
  2629            }, (#struct){
  2630              b: (string){ string }
  2631              c: (int){ int }
  2632            }, (#struct){
  2633              b: (string){ string }
  2634              d: (string){ string }
  2635            }) }
  2636        }
  2637        p2: (struct){
  2638          #A: (#struct){ |(*(#struct){
  2639              a: (string){ string }
  2640            }, (#struct){
  2641              a: (string){ string }
  2642              c: (int){ int }
  2643            }, (#struct){
  2644              a: (string){ string }
  2645              d: (string){ string }
  2646            }) }
  2647          #B: (#struct){ |(*(#struct){
  2648            }, (#struct){
  2649              a: (string){ string }
  2650              c: (int){ int }
  2651            }, (#struct){
  2652              a: (string){ string }
  2653              d: (string){ string }
  2654            }, (#struct){
  2655              a: (string){ string }
  2656            }, (#struct){
  2657              c: (int){ int }
  2658            }, (#struct){
  2659              d: (string){ string }
  2660            }, (#struct){
  2661              b: (string){ string }
  2662            }, (#struct){
  2663              b: (string){ string }
  2664              c: (int){ int }
  2665            }, (#struct){
  2666              b: (string){ string }
  2667              d: (string){ string }
  2668            }) }
  2669        }
  2670        p3: (struct){
  2671          #A: (#struct){ |(*(#struct){
  2672              a: (string){ string }
  2673            }, (#struct){
  2674              a: (string){ string }
  2675              c: (int){ int }
  2676            }, (#struct){
  2677              a: (string){ string }
  2678              d: (string){ string }
  2679            }) }
  2680          #B: (#struct){ |(*(#struct){
  2681            }, (#struct){
  2682              a: (string){ string }
  2683              c: (int){ int }
  2684            }, (#struct){
  2685              a: (string){ string }
  2686              d: (string){ string }
  2687            }, (#struct){
  2688              b: (string){ string }
  2689            }, (#struct){
  2690              b: (string){ string }
  2691              c: (int){ int }
  2692            }, (#struct){
  2693              b: (string){ string }
  2694              d: (string){ string }
  2695            }, (#struct){
  2696              a: (string){ string }
  2697            }, (#struct){
  2698              c: (int){ int }
  2699            }, (#struct){
  2700              d: (string){ string }
  2701            }) }
  2702        }
  2703      }
  2704    }
  2705    noChildError: (struct){
  2706      issue1608: (struct){
  2707        myValue: (#struct){
  2708          fieldName: (string){ "some string" }
  2709        }
  2710        #type: (#struct){
  2711          fieldName: ((string|struct)){ |((string){ string }, (#struct){
  2712              foo: (string){ string }
  2713            }, (#struct){
  2714              bar: ((string|struct)){ |((string){ string }, (#struct){
  2715                  foo: (string){ string }
  2716                }) }
  2717            }) }
  2718        }
  2719        #subtype: ((string|struct)){ |((string){ string }, (#struct){
  2720            foo: (string){ string }
  2721          }) }
  2722      }
  2723      t1: (struct){
  2724        #D: (#struct){
  2725          b: (string){ string }
  2726        }
  2727        o: (#struct){
  2728          b: (string){ "test" }
  2729        }
  2730      }
  2731      t2: (struct){
  2732        o: (#struct){
  2733          b: (string){ "test" }
  2734        }
  2735        #D: (#struct){
  2736          b: (string){ string }
  2737        }
  2738      }
  2739      t3: (struct){
  2740        #D: (#struct){ |((#struct){
  2741            a: (null){ null }
  2742          }, (#struct){
  2743            b: (string){ string }
  2744          }) }
  2745        o: (#struct){
  2746          b: (string){ "test" }
  2747        }
  2748      }
  2749      t4: (struct){
  2750        o: (#struct){
  2751          b: (string){ "test" }
  2752        }
  2753        #D: (#struct){ |((#struct){
  2754            a: (null){ null }
  2755          }, (#struct){
  2756            b: (string){ string }
  2757          }) }
  2758      }
  2759    }
  2760    issue1924: (struct){
  2761      t1: (struct){
  2762        m: (struct){
  2763          a: (int){ 2 }
  2764        }
  2765        x: (int){ 2 }
  2766      }
  2767      t2: (struct){
  2768        m: (struct){
  2769          a: (int){ 2 }
  2770        }
  2771        x: (int){ 3 }
  2772      }
  2773      t3: (struct){
  2774        m: (struct){
  2775          a: (int){ 2 }
  2776        }
  2777        x: (int){ 1 }
  2778      }
  2779    }
  2780    issue1838: (struct){
  2781      t1: (struct){
  2782        p?: (#list){
  2783        }
  2784        a: (null){ null }
  2785      }
  2786      t2: (struct){
  2787        p?: (#list){
  2788        }
  2789        a: (null){ null }
  2790      }
  2791    }
  2792    noHang: (struct){
  2793      #T: (list){
  2794        0: (string){ "d" }
  2795      }
  2796      x: (list){
  2797        0: (string){ "d" }
  2798      }
  2799      #X: (list){
  2800        0: (string){ "d" }
  2801      }
  2802    }
  2803    issue1940: (struct){
  2804      #T: (#list){
  2805        0: (string){ "d" }
  2806        1: (list){
  2807        }
  2808      }
  2809      #A: (#struct){
  2810        type: (#list){
  2811          0: (string){ "d" }
  2812          1: (list){
  2813          }
  2814        }
  2815      }
  2816      #B: (#struct){
  2817      }
  2818      #C: (#struct){
  2819        x: (#struct){
  2820          type: (#list){
  2821            0: (string){ "d" }
  2822            1: (list){
  2823            }
  2824          }
  2825        }
  2826      }
  2827    }
  2828    issue1417: (_|_){
  2829      // [eval]
  2830      #ID: (string){ |((string){ &(!~"^a", =~"^a") }, (string){ &(!~"^a", !~"[A-Z]") }, (string){ &(=~"^ab$", =~"^a") }, (string){ &(=~"^ab$", !~"[A-Z]") }, (string){ &(=~"^aB$", =~"^a") }, (string){ &(=~"^aB$", !~"[A-Z]") }) }
  2831      ids: (_|_){
  2832        // [eval]
  2833        0: (string){ "xyz" }
  2834        1: (_|_){
  2835          // [eval] issue1417.ids.1: invalid value "ab" (out of bound !~"^a"):
  2836          //     ./issue1417.cue:2:7
  2837          //     ./issue1417.cue:4:11
  2838          //     ./issue1417.cue:4:26
  2839        }
  2840        2: (_|_){
  2841          // [eval] issue1417.ids.2: 2 errors in empty disjunction:
  2842          // issue1417.ids.2: invalid value "aB" (out of bound !~"^a"):
  2843          //     ./issue1417.cue:2:7
  2844          //     ./issue1417.cue:4:11
  2845          //     ./issue1417.cue:4:32
  2846          // issue1417.ids.2: invalid value "aB" (out of bound !~"[A-Z]"):
  2847          //     ./issue1417.cue:3:16
  2848          //     ./issue1417.cue:4:11
  2849          //     ./issue1417.cue:4:32
  2850        }
  2851      }
  2852    }
  2853    issue2209: (_|_){
  2854      // [eval]
  2855      simplified: (_|_){
  2856        // [eval]
  2857        t1: (struct){
  2858          #SpecFoo: (#struct){
  2859            foo: (#struct){
  2860              min: (int){ 1 }
  2861            }
  2862          }
  2863          #SpecBar: (#struct){
  2864            bar: (#struct){
  2865              min: (int){ 1 }
  2866            }
  2867          }
  2868          spec: (#struct){
  2869            bar: (#struct){
  2870              min: (int){ 1 }
  2871            }
  2872          }
  2873          out: (struct){ |((struct){
  2874              X: (#struct){
  2875                bar: (#struct){
  2876                  min: (int){ 1 }
  2877                }
  2878              }
  2879              nullFoo: (null){ null }
  2880              minFoo: (int){ int }
  2881            }, (struct){
  2882              minBar: (int){ int }
  2883              X: (#struct){
  2884                bar: (#struct){
  2885                  min: (int){ 1 }
  2886                }
  2887              }
  2888              nullFoo: (null){ null }
  2889            }, (struct){
  2890              X: (#struct){
  2891                bar: (#struct){
  2892                  min: (int){ 1 }
  2893                }
  2894              }
  2895              nullBar: (null){ null }
  2896              minFoo: (int){ int }
  2897            }, (struct){
  2898              minBar: (int){ int }
  2899              X: (#struct){
  2900                bar: (#struct){
  2901                  min: (int){ 1 }
  2902                }
  2903              }
  2904              nullBar: (null){ null }
  2905            }) }
  2906        }
  2907        t2: (_|_){
  2908          // [incomplete] issue2209.simplified.t2.BAZ: undefined field: x:
  2909          //     ./issue2209full.cue:24:17
  2910          #SpecFoo: (#struct){
  2911            foo: (#struct){
  2912            }
  2913          }
  2914          #SpecBar: (#struct){
  2915            bar: (#struct){
  2916              x: (int){ 1 }
  2917            }
  2918          }
  2919          spec: (#struct){ |(*(#struct){
  2920              bar: (struct){
  2921              }
  2922              foo: (#struct){
  2923              }
  2924            }, (#struct){
  2925              bar: (#struct){
  2926                x: (int){ 1 }
  2927              }
  2928            }) }
  2929          BAZ: (_|_){
  2930            // [incomplete] issue2209.simplified.t2.BAZ: undefined field: x:
  2931            //     ./issue2209full.cue:24:17
  2932          }
  2933          b2: (int){ int }
  2934        }
  2935        t3: (_|_){
  2936          // [eval] issue2209.simplified.t3.BAZ: undefined field: y:
  2937          //     ./issue2209full.cue:35:9
  2938          #A: (#struct){
  2939            v: (int){ 1 }
  2940          }
  2941          BAZ: (_|_){
  2942            // [eval] issue2209.simplified.t3.BAZ: undefined field: y:
  2943            //     ./issue2209full.cue:35:9
  2944          }
  2945          S: (#struct){ |(*(#struct){
  2946              x: (int){ 1 }
  2947              v: (int){ 1 }
  2948            }, (#struct){
  2949              x: (int){ 1 }
  2950              y: (int){ 1 }
  2951            }) }
  2952          #B: (#struct){
  2953            x: (int){ 1 }
  2954            y: (int){ 1 }
  2955          }
  2956          b2: (int){ int }
  2957        }
  2958      }
  2959      full: (_|_){
  2960        // [eval]
  2961        Foo: (#struct){
  2962          spec: (#struct){
  2963            foo: (#struct){
  2964              min: (int){ |(*(int){ 10 }, (int){ int }) }
  2965              max: (int){ |(*(int){ 20 }, (int){ int }) }
  2966            }
  2967          }
  2968          resource: (#struct){
  2969            spec: (#struct){ |(*(#struct){
  2970                minFoo: (int){ |(*(int){ 10 }, (int){ int }) }
  2971                maxFoo: (int){ |(*(int){ 20 }, (int){ int }) }
  2972                minBar?: (null){ null }
  2973                maxBar?: (null){ null }
  2974                hoge?: ((null|bool)){ |((null){ null }, (bool){ bool }) }
  2975                fuga?: (null){ null }
  2976              }, (#struct){
  2977                minFoo: (int){ |(*(int){ 10 }, (int){ int }) }
  2978                maxFoo: (int){ |(*(int){ 20 }, (int){ int }) }
  2979                minBar?: (null){ null }
  2980                maxBar?: (null){ null }
  2981                hoge?: (null){ null }
  2982                fuga?: ((null|bool)){ |((null){ null }, (bool){ bool }) }
  2983              }) }
  2984            _X: (#struct){
  2985              spec: (#struct){ |(*(#struct){
  2986                  foo: (#struct){
  2987                    min: (int){ |(*(int){ 10 }, (int){ int }) }
  2988                    max: (int){ |(*(int){ 20 }, (int){ int }) }
  2989                  }
  2990                }, (#struct){
  2991                  foo: (#struct){
  2992                  }
  2993                  bar: (#struct){
  2994                    min: (int){ |(*(int){ 30 }, (int){ int }) }
  2995                    max: (int){ |(*(int){ 40 }, (int){ int }) }
  2996                  }
  2997                }) }
  2998            }
  2999          }
  3000        }
  3001        Bar: (_|_){
  3002          // [eval]
  3003          spec: (#struct){
  3004            bar: (#struct){
  3005              min: (int){ |(*(int){ 30 }, (int){ int }) }
  3006              max: (int){ |(*(int){ 40 }, (int){ int }) }
  3007            }
  3008          }
  3009          resource: (_|_){
  3010            // [eval]
  3011            spec: (_|_){
  3012              // [eval] issue2209.full.Bar.resource.spec: 6 errors in empty disjunction:
  3013              // issue2209.full.Bar.resource.spec.minBar: 2 errors in empty disjunction:
  3014              // issue2209.full.Bar.resource.spec.minBar: conflicting values null and int (mismatched types null and int):
  3015              //     ./issue2209full.cue:43:7
  3016              //     ./issue2209full.cue:48:13
  3017              //     ./issue2209full.cue:67:10
  3018              //     ./issue2209full.cue:83:16
  3019              //     ./issue2209full.cue:87:13
  3020              //     ./issue2209full.cue:107:20
  3021              // issue2209.full.Bar.resource.spec.minFoo: 2 errors in empty disjunction:
  3022              // issue2209.full.Bar.resource.spec.minFoo: conflicting values null and 10 (mismatched types null and int):
  3023              //     ./issue2209full.cue:43:7
  3024              //     ./issue2209full.cue:48:13
  3025              //     ./issue2209full.cue:55:16
  3026              //     ./issue2209full.cue:71:4
  3027              //     ./issue2209full.cue:72:13
  3028              //     ./issue2209full.cue:92:13
  3029              // issue2209.full.Bar.resource.spec.minFoo: conflicting values null and int (mismatched types null and int):
  3030              //     ./issue2209full.cue:43:7
  3031              //     ./issue2209full.cue:48:13
  3032              //     ./issue2209full.cue:67:10
  3033              //     ./issue2209full.cue:83:16
  3034              //     ./issue2209full.cue:92:13
  3035              //     ./issue2209full.cue:105:20
  3036              // issue2209.full.Bar.resource.spec.minBar: undefined field: min:
  3037              //     ./issue2209full.cue:77:25
  3038              minFoo: (_|_){
  3039                // [eval] issue2209.full.Bar.resource.spec.minFoo: 2 errors in empty disjunction:
  3040                // issue2209.full.Bar.resource.spec.minFoo: conflicting values null and 10 (mismatched types null and int):
  3041                //     ./issue2209full.cue:43:7
  3042                //     ./issue2209full.cue:48:13
  3043                //     ./issue2209full.cue:55:16
  3044                //     ./issue2209full.cue:71:4
  3045                //     ./issue2209full.cue:72:13
  3046                //     ./issue2209full.cue:92:13
  3047                // issue2209.full.Bar.resource.spec.minFoo: conflicting values null and int (mismatched types null and int):
  3048                //     ./issue2209full.cue:43:7
  3049                //     ./issue2209full.cue:48:13
  3050                //     ./issue2209full.cue:67:10
  3051                //     ./issue2209full.cue:83:16
  3052                //     ./issue2209full.cue:92:13
  3053                //     ./issue2209full.cue:105:20
  3054              }
  3055              maxFoo: (_|_){
  3056                // [eval] issue2209.full.Bar.resource.spec.maxFoo: 2 errors in empty disjunction:
  3057                // issue2209.full.Bar.resource.spec.maxFoo: conflicting values null and 20 (mismatched types null and int):
  3058                //     ./issue2209full.cue:43:7
  3059                //     ./issue2209full.cue:48:13
  3060                //     ./issue2209full.cue:56:16
  3061                //     ./issue2209full.cue:71:4
  3062                //     ./issue2209full.cue:73:13
  3063                //     ./issue2209full.cue:93:13
  3064                // issue2209.full.Bar.resource.spec.maxFoo: conflicting values null and int (mismatched types null and int):
  3065                //     ./issue2209full.cue:43:7
  3066                //     ./issue2209full.cue:48:13
  3067                //     ./issue2209full.cue:67:10
  3068                //     ./issue2209full.cue:83:16
  3069                //     ./issue2209full.cue:93:13
  3070                //     ./issue2209full.cue:106:20
  3071              }
  3072              minBar: (_|_){
  3073                // [eval] issue2209.full.Bar.resource.spec.minBar: undefined field: min:
  3074                //     ./issue2209full.cue:77:25
  3075              }
  3076              maxBar: (_|_){
  3077                // [eval] issue2209.full.Bar.resource.spec.maxBar: undefined field: max:
  3078                //     ./issue2209full.cue:78:25
  3079              }
  3080              hoge?: ((null|bool)){ |((null){ null }, (bool){ bool }) }
  3081              fuga?: ((null|bool)){ |((null){ null }, (bool){ bool }) }
  3082            }
  3083            _X: (#struct){
  3084              spec: (#struct){ |(*(#struct){
  3085                  bar: (#struct){
  3086                  }
  3087                  foo: (#struct){
  3088                    min: (int){ |(*(int){ 10 }, (int){ int }) }
  3089                    max: (int){ |(*(int){ 20 }, (int){ int }) }
  3090                  }
  3091                }, (#struct){
  3092                  bar: (#struct){
  3093                    min: (int){ |(*(int){ 30 }, (int){ int }) }
  3094                    max: (int){ |(*(int){ 40 }, (int){ int }) }
  3095                  }
  3096                }) }
  3097            }
  3098          }
  3099        }
  3100        #Abstract: (#struct){
  3101          spec: (#struct){ |(*(#struct){
  3102              foo: (#struct){
  3103                min: (int){ |(*(int){ 10 }, (int){ int }) }
  3104                max: (int){ |(*(int){ 20 }, (int){ int }) }
  3105              }
  3106            }, (#struct){
  3107              bar: (#struct){
  3108                min: (int){ |(*(int){ 30 }, (int){ int }) }
  3109                max: (int){ |(*(int){ 40 }, (int){ int }) }
  3110              }
  3111            }) }
  3112          resource: (#struct){
  3113            spec: (#struct){ |(*(#struct){
  3114                minFoo: (int){ |(*(int){ 10 }, (int){ int }) }
  3115                maxFoo: (int){ |(*(int){ 20 }, (int){ int }) }
  3116                minBar?: (null){ null }
  3117                maxBar?: (null){ null }
  3118                hoge?: ((null|bool)){ |((null){ null }, (bool){ bool }) }
  3119                fuga?: (null){ null }
  3120              }, (#struct){
  3121                minFoo: (int){ |(*(int){ 10 }, (int){ int }) }
  3122                maxFoo: (int){ |(*(int){ 20 }, (int){ int }) }
  3123                minBar?: (null){ null }
  3124                maxBar?: (null){ null }
  3125                hoge?: (null){ null }
  3126                fuga?: ((null|bool)){ |((null){ null }, (bool){ bool }) }
  3127              }) }
  3128            _X: (#struct){
  3129              spec: (#struct){ |(*(#struct){
  3130                  foo: (#struct){
  3131                    min: (int){ |(*(int){ 10 }, (int){ int }) }
  3132                    max: (int){ |(*(int){ 20 }, (int){ int }) }
  3133                  }
  3134                }, (#struct){
  3135                  bar: (#struct){
  3136                    min: (int){ |(*(int){ 30 }, (int){ int }) }
  3137                    max: (int){ |(*(int){ 40 }, (int){ int }) }
  3138                  }
  3139                }) }
  3140            }
  3141          }
  3142        }
  3143        _#Spec: (#struct){ |(*(#struct){
  3144            foo: (#struct){
  3145              min: (int){ |(*(int){ 10 }, (int){ int }) }
  3146              max: (int){ |(*(int){ 20 }, (int){ int }) }
  3147            }
  3148          }, (#struct){
  3149            bar: (#struct){
  3150              min: (int){ |(*(int){ 30 }, (int){ int }) }
  3151              max: (int){ |(*(int){ 40 }, (int){ int }) }
  3152            }
  3153          }) }
  3154        _#SpecFoo: (#struct){
  3155          foo: (#struct){
  3156            min: (int){ |(*(int){ 10 }, (int){ int }) }
  3157            max: (int){ |(*(int){ 20 }, (int){ int }) }
  3158          }
  3159        }
  3160        _#SpecBar: (#struct){
  3161          bar: (#struct){
  3162            min: (int){ |(*(int){ 30 }, (int){ int }) }
  3163            max: (int){ |(*(int){ 40 }, (int){ int }) }
  3164          }
  3165        }
  3166        _Thing: (#struct){
  3167          spec: (#struct){ |(*(#struct){
  3168              minFoo: (int){ |(*(int){ 10 }, (int){ int }) }
  3169              maxFoo: (int){ |(*(int){ 20 }, (int){ int }) }
  3170              minBar?: (null){ null }
  3171              maxBar?: (null){ null }
  3172              hoge?: ((null|bool)){ |((null){ null }, (bool){ bool }) }
  3173              fuga?: (null){ null }
  3174            }, *(#struct){
  3175              minFoo?: (null){ null }
  3176              maxFoo?: (null){ null }
  3177              minBar: (int){ |(*(int){ 30 }, (int){ int }) }
  3178              maxBar: (int){ |(*(int){ 40 }, (int){ int }) }
  3179              hoge?: ((null|bool)){ |((null){ null }, (bool){ bool }) }
  3180              fuga?: (null){ null }
  3181            }, (#struct){
  3182              minFoo: (int){ |(*(int){ 10 }, (int){ int }) }
  3183              maxFoo: (int){ |(*(int){ 20 }, (int){ int }) }
  3184              minBar?: (null){ null }
  3185              maxBar?: (null){ null }
  3186              hoge?: (null){ null }
  3187              fuga?: ((null|bool)){ |((null){ null }, (bool){ bool }) }
  3188            }, (#struct){
  3189              minFoo?: (null){ null }
  3190              maxFoo?: (null){ null }
  3191              minBar: (int){ |(*(int){ 30 }, (int){ int }) }
  3192              maxBar: (int){ |(*(int){ 40 }, (int){ int }) }
  3193              hoge?: (null){ null }
  3194              fuga?: ((null|bool)){ |((null){ null }, (bool){ bool }) }
  3195            }) }
  3196          _X: (_){ _ }
  3197        }
  3198        #Constrained: (#struct){
  3199          spec: (#struct){ |(*(#struct){
  3200              minFoo: (int){ |(*(int){ 10 }, (int){ int }) }
  3201              maxFoo: (int){ |(*(int){ 20 }, (int){ int }) }
  3202              minBar?: (null){ null }
  3203              maxBar?: (null){ null }
  3204              hoge?: ((null|bool)){ |((null){ null }, (bool){ bool }) }
  3205              fuga?: (null){ null }
  3206            }, *(#struct){
  3207              minFoo?: (null){ null }
  3208              maxFoo?: (null){ null }
  3209              minBar: (int){ |(*(int){ 30 }, (int){ int }) }
  3210              maxBar: (int){ |(*(int){ 40 }, (int){ int }) }
  3211              hoge?: ((null|bool)){ |((null){ null }, (bool){ bool }) }
  3212              fuga?: (null){ null }
  3213            }, (#struct){
  3214              minFoo: (int){ |(*(int){ 10 }, (int){ int }) }
  3215              maxFoo: (int){ |(*(int){ 20 }, (int){ int }) }
  3216              minBar?: (null){ null }
  3217              maxBar?: (null){ null }
  3218              hoge?: (null){ null }
  3219              fuga?: ((null|bool)){ |((null){ null }, (bool){ bool }) }
  3220            }, (#struct){
  3221              minFoo?: (null){ null }
  3222              maxFoo?: (null){ null }
  3223              minBar: (int){ |(*(int){ 30 }, (int){ int }) }
  3224              maxBar: (int){ |(*(int){ 40 }, (int){ int }) }
  3225              hoge?: (null){ null }
  3226              fuga?: ((null|bool)){ |((null){ null }, (bool){ bool }) }
  3227            }) }
  3228        }
  3229        #Base: (#struct){
  3230          spec: (#struct){
  3231            minFoo?: ((null|int)){ |((null){ null }, (int){ int }) }
  3232            maxFoo?: ((null|int)){ |((null){ null }, (int){ int }) }
  3233            minBar?: ((null|int)){ |((null){ null }, (int){ int }) }
  3234            maxBar?: ((null|int)){ |((null){ null }, (int){ int }) }
  3235            hoge?: ((null|bool)){ |((null){ null }, (bool){ bool }) }
  3236            fuga?: ((null|bool)){ |((null){ null }, (bool){ bool }) }
  3237          }
  3238        }
  3239      }
  3240    }
  3241    issue2246: (struct){
  3242      simplified: (struct){
  3243        #FormFoo: (#struct){
  3244          fooID: (string){ string }
  3245        }
  3246        #FormBar: (#struct){
  3247          barID: (string){ string }
  3248        }
  3249        #Form: (#struct){ |((#struct){
  3250            fooID: (string){ string }
  3251          }, (#struct){
  3252            barID: (string){ string }
  3253          }) }
  3254        data: (struct){
  3255          fooID: (string){ "123" }
  3256        }
  3257        out1: (#struct){
  3258          fooID: (string){ "123" }
  3259        }
  3260        out2: (#struct){
  3261          fooID: (string){ "123" }
  3262        }
  3263      }
  3264      full: (struct){
  3265        data: (struct){
  3266          forms: (#list){
  3267            0: (struct){
  3268              fooID: (string){ "00-0000001" }
  3269            }
  3270          }
  3271        }
  3272        form1040: (#list){
  3273          0: (int){ 3 }
  3274        }
  3275        #K1: (#struct){
  3276          #_base: (#struct){
  3277            common: (int){ 3 }
  3278          }
  3279          #FormFoo: (#struct){
  3280            common: (int){ 3 }
  3281            fooID: (string){ string }
  3282          }
  3283          #FormBar: (#struct){
  3284            common: (int){ 3 }
  3285            barID: (string){ string }
  3286          }
  3287          #Form: (#struct){ |((#struct){
  3288              common: (int){ 3 }
  3289              fooID: (string){ string }
  3290            }, (#struct){
  3291              common: (int){ 3 }
  3292              barID: (string){ string }
  3293            }) }
  3294        }
  3295        #Input: (#struct){
  3296          forms: (list){
  3297          }
  3298        }
  3299        #summarizeReturn: (#struct){
  3300          in: (#struct){
  3301            forms: (list){
  3302            }
  3303          }
  3304          out: (#list){
  3305          }
  3306        }
  3307        #compute: (#struct){
  3308          in: (#struct){
  3309            forms: (list){
  3310            }
  3311          }
  3312          out: (#list){
  3313          }
  3314        }
  3315      }
  3316    }
  3317    issue2263: (struct){
  3318      simplified: (struct){
  3319        metrics: (#struct){
  3320          id: (string){ "foo" }
  3321          avg: (int){ 60 }
  3322        }
  3323        #Metric: (#struct){ |((#struct){
  3324            id: (string){ string }
  3325            avg: (number){ number }
  3326          }, (#struct){
  3327            id: (string){ string }
  3328          }, (#struct){
  3329            avg: (number){ number }
  3330          }, (#struct){
  3331          }) }
  3332        #IDSource: (#struct){
  3333          id: (string){ string }
  3334        }
  3335        #TargetAverage: (#struct){
  3336          avg: (number){ number }
  3337        }
  3338      }
  3339      full: (struct){
  3340        metrics: (#list){
  3341          0: (#struct){
  3342            id: (string){ "foo" }
  3343            avg: (int){ 60 }
  3344          }
  3345          1: (#struct){
  3346            id: (string){ "bar" }
  3347            value: (int){ 80 }
  3348          }
  3349          2: (#struct){
  3350            uri: (string){ "baz" }
  3351            avg: (int){ 70 }
  3352          }
  3353          3: (#struct){
  3354            uri: (string){ "qux" }
  3355            value: (int){ 90 }
  3356          }
  3357        }
  3358        #Metric: (#struct){ |((#struct){
  3359            id: (string){ string }
  3360            avg: (number){ number }
  3361          }, (#struct){
  3362            id: (string){ string }
  3363            value: (number){ number }
  3364          }, (#struct){
  3365            uri: (string){ string }
  3366            avg: (number){ number }
  3367          }, (#struct){
  3368            uri: (string){ string }
  3369            value: (number){ number }
  3370          }) }
  3371        #Source: (#struct){ |((#struct){
  3372            id: (string){ string }
  3373          }, (#struct){
  3374            uri: (string){ string }
  3375          }) }
  3376        #Target: (#struct){ |((#struct){
  3377            avg: (number){ number }
  3378          }, (#struct){
  3379            value: (number){ number }
  3380          }) }
  3381        #IDSource: (#struct){
  3382          id: (string){ string }
  3383        }
  3384        #URISource: (#struct){
  3385          uri: (string){ string }
  3386        }
  3387        #TargetAverage: (#struct){
  3388          avg: (number){ number }
  3389        }
  3390        #TargetValue: (#struct){
  3391          value: (number){ number }
  3392        }
  3393      }
  3394    }
  3395    issue3149: (_|_){
  3396      // [eval]
  3397      #valid: (#struct){
  3398        name!: (string){ |((string){ &(=~"^Foo", =~"Foo$") }, (string){ "an exception" }) }
  3399      }
  3400      list: (_|_){
  3401        // [eval]
  3402        0: (#struct){
  3403          name: (string){ "FooBarFoo" }
  3404        }
  3405        1: (#struct){
  3406          name: (string){ "FooBazFoo" }
  3407        }
  3408        2: (#struct){
  3409          name: (string){ "FooQuuxFoo" }
  3410        }
  3411        3: (_|_){
  3412          // [eval]
  3413          name: (_|_){
  3414            // [eval] issue3149.list.3.name: 2 errors in empty disjunction:
  3415            // issue3149.list.3.name: invalid value "an exception" (out of bound =~"^Foo"):
  3416            //     ./issue3149.cue:3:13
  3417            //     ./issue3149.cue:3:10
  3418            //     ./issue3149.cue:10:10
  3419            // issue3149.list.3.name: invalid value "an exception" (out of bound =~"Foo$"):
  3420            //     ./issue3149.cue:3:46
  3421            //     ./issue3149.cue:3:10
  3422            //     ./issue3149.cue:10:10
  3423          }
  3424        }
  3425      }
  3426    }
  3427    issue770: (struct){
  3428      #A: (#struct){
  3429        v: (string){ |((string){ "a" }, (string){ "b" }, (string){ "c" }) }
  3430      }
  3431      h: (struct){
  3432        a: (#struct){
  3433          v: (string){ |(*(string){ "a" }, (string){ "b" }, (string){ "c" }) }
  3434        }
  3435        b: (#struct){
  3436          v: (string){ |(*(string){ "a" }, (string){ "b" }, (string){ "c" }) }
  3437        }
  3438        boo: (#struct){
  3439          v: (string){ |(*(string){ "a" }, (string){ "b" }, (string){ "c" }) }
  3440        }
  3441        c: (#struct){
  3442          v: (string){ |(*(string){ "a" }, *(string){ "b" }, *(string){ "c" }) }
  3443        }
  3444        coo: (#struct){
  3445          v: (string){ |(*(string){ "a" }, *(string){ "b" }, *(string){ "c" }) }
  3446        }
  3447      }
  3448    }
  3449  }
  3450  -- out/compile --
  3451  --- in.cue
  3452  {
  3453    disambiguateClosed: {
  3454      b: (〈0;#Def〉 & 〈0;a〉)
  3455      a: 〈0;#Def〉
  3456      #Def: {
  3457        ({
  3458          x: true
  3459        }|{
  3460          y: true
  3461        })
  3462      }
  3463    }
  3464    alwaysCheckMatchers1: {
  3465      b: ({
  3466        [=~"^xxxx$"]: int
  3467      }|null)
  3468      b: ({
  3469        c: string
  3470      }|null)
  3471      b: {
  3472        c: "yyyyy"
  3473      }
  3474    }
  3475    alwaysCheckPatterns2: {
  3476      a: 〈0;#X〉
  3477      a: 〈0;b〉
  3478      b: 〈0;#X〉
  3479      b: {
  3480        c: "yyyyy"
  3481      }
  3482      #X: (string|{
  3483        c: string
  3484        {
  3485          [=~"^xxxx$"]: int
  3486        }
  3487      })
  3488    }
  3489    nestedNonMonotonic: {
  3490      resolved: {
  3491        n1: {
  3492          x: ({
  3493            a: 〈import;struct〉.MinFields(2)
  3494          }|null)
  3495          x: ({
  3496            a: {
  3497              c: 1
  3498            }
  3499          }|null)
  3500          x: ({
  3501            a: {
  3502              d: 1
  3503            }
  3504          }|null)
  3505        }
  3506      }
  3507    }
  3508    nestedNonMonotonic: {
  3509      resolved: {
  3510        n2: {
  3511          x: ({
  3512            a: {
  3513              b: 〈import;struct〉.MinFields(2)
  3514            }
  3515          }|null)
  3516          x: ({
  3517            a: {
  3518              b: {
  3519                c: 1
  3520              }
  3521            }
  3522          }|null)
  3523          x: ({
  3524            a: {
  3525              b: {
  3526                d: 1
  3527              }
  3528            }
  3529          }|null)
  3530        }
  3531      }
  3532    }
  3533    nestedNonMonotonic: {
  3534      eliminated: {
  3535        n1: {
  3536          p1: {
  3537            x: ({
  3538              a: 〈import;struct〉.MaxFields(1)
  3539            }|null)
  3540            x: ({
  3541              a: {
  3542                c: 1
  3543              }
  3544            }|null)
  3545            x: ({
  3546              a: {
  3547                d: 1
  3548              }
  3549            }|null)
  3550          }
  3551        }
  3552      }
  3553    }
  3554    nestedNonMonotonic: {
  3555      eliminated: {
  3556        n1: {
  3557          p2: {
  3558            x: ({
  3559              a: {
  3560                c: 1
  3561              }
  3562            }|null)
  3563            x: ({
  3564              a: 〈import;struct〉.MaxFields(1)
  3565            }|null)
  3566            x: ({
  3567              a: {
  3568                d: 1
  3569              }
  3570            }|null)
  3571          }
  3572        }
  3573      }
  3574    }
  3575    nestedNonMonotonic: {
  3576      eliminated: {
  3577        n1: {
  3578          p2: {
  3579            x: ({
  3580              a: {
  3581                c: 1
  3582              }
  3583            }|null)
  3584            x: ({
  3585              a: {
  3586                d: 1
  3587              }
  3588            }|null)
  3589            x: ({
  3590              a: 〈import;struct〉.MaxFields(1)
  3591            }|null)
  3592          }
  3593        }
  3594      }
  3595    }
  3596    nestedNonMonotonic: {
  3597      eliminated: {
  3598        n2: {
  3599          p1: {
  3600            x: ({
  3601              a: {
  3602                b: 〈import;struct〉.MaxFields(1)
  3603              }
  3604            }|null)
  3605            x: ({
  3606              a: {
  3607                b: {
  3608                  c: 1
  3609                }
  3610              }
  3611            }|null)
  3612            x: ({
  3613              a: {
  3614                b: {
  3615                  d: 1
  3616                }
  3617              }
  3618            }|null)
  3619          }
  3620        }
  3621      }
  3622    }
  3623    nestedNonMonotonic: {
  3624      eliminated: {
  3625        n2: {
  3626          p2: {
  3627            x: ({
  3628              a: {
  3629                b: {
  3630                  c: 1
  3631                }
  3632              }
  3633            }|null)
  3634            x: ({
  3635              a: {
  3636                b: 〈import;struct〉.MaxFields(1)
  3637              }
  3638            }|null)
  3639            x: ({
  3640              a: {
  3641                b: {
  3642                  d: 1
  3643                }
  3644              }
  3645            }|null)
  3646          }
  3647        }
  3648      }
  3649    }
  3650    nestedNonMonotonic: {
  3651      eliminated: {
  3652        n2: {
  3653          p2: {
  3654            x: ({
  3655              a: {
  3656                b: {
  3657                  c: 1
  3658                }
  3659              }
  3660            }|null)
  3661            x: ({
  3662              a: {
  3663                b: {
  3664                  d: 1
  3665                }
  3666              }
  3667            }|null)
  3668            x: ({
  3669              a: {
  3670                b: 〈import;struct〉.MaxFields(1)
  3671              }
  3672            }|null)
  3673          }
  3674        }
  3675      }
  3676    }
  3677    nestedNonMonotonic: {
  3678      incomplete: {
  3679        a: {
  3680          n1: {
  3681            p1: {
  3682              x: ({
  3683                a: 〈import;struct〉.MinFields(2)
  3684              }|null)
  3685              x: ({
  3686                a: {
  3687                  c: 1
  3688                }
  3689              }|null)
  3690            }
  3691          }
  3692        }
  3693      }
  3694    }
  3695    nestedNonMonotonic: {
  3696      incomplete: {
  3697        a: {
  3698          n1: {
  3699            p2: {
  3700              x: ({
  3701                a: {
  3702                  c: 1
  3703                }
  3704              }|null)
  3705              x: ({
  3706                a: 〈import;struct〉.MinFields(2)
  3707              }|null)
  3708            }
  3709          }
  3710        }
  3711      }
  3712    }
  3713    nestedNonMonotonic: {
  3714      incomplete: {
  3715        a: {
  3716          n2: {
  3717            p1: {
  3718              x: ({
  3719                a: {
  3720                  b: 〈import;struct〉.MinFields(2)
  3721                }
  3722              }|null)
  3723              x: ({
  3724                a: {
  3725                  b: {
  3726                    c: 1
  3727                  }
  3728                }
  3729              }|null)
  3730            }
  3731          }
  3732        }
  3733      }
  3734    }
  3735    nestedNonMonotonic: {
  3736      incomplete: {
  3737        a: {
  3738          n2: {
  3739            p2: {
  3740              x: ({
  3741                a: {
  3742                  b: {
  3743                    c: 1
  3744                  }
  3745                }
  3746              }|null)
  3747              x: ({
  3748                a: {
  3749                  b: 〈import;struct〉.MinFields(2)
  3750                }
  3751              }|null)
  3752            }
  3753          }
  3754        }
  3755      }
  3756    }
  3757    nestedNonMonotonic: {
  3758      incomplete: {
  3759        b: {
  3760          n1: {
  3761            p1: {
  3762              x: ({
  3763                a: 〈import;struct〉.MinFields(3)
  3764              }|null)
  3765              x: ({
  3766                a: {
  3767                  c: 1
  3768                }
  3769              }|null)
  3770              x: ({
  3771                a: {
  3772                  d: 1
  3773                }
  3774              }|null)
  3775            }
  3776          }
  3777        }
  3778      }
  3779    }
  3780    nestedNonMonotonic: {
  3781      incomplete: {
  3782        b: {
  3783          n1: {
  3784            p2: {
  3785              x: ({
  3786                a: {
  3787                  c: 1
  3788                }
  3789              }|null)
  3790              x: ({
  3791                a: 〈import;struct〉.MinFields(3)
  3792              }|null)
  3793              x: ({
  3794                a: {
  3795                  d: 1
  3796                }
  3797              }|null)
  3798            }
  3799          }
  3800        }
  3801      }
  3802    }
  3803    nestedNonMonotonic: {
  3804      incomplete: {
  3805        b: {
  3806          n1: {
  3807            p3: {
  3808              x: ({
  3809                a: {
  3810                  c: 1
  3811                }
  3812              }|null)
  3813              x: ({
  3814                a: {
  3815                  d: 1
  3816                }
  3817              }|null)
  3818              x: ({
  3819                a: 〈import;struct〉.MinFields(3)
  3820              }|null)
  3821            }
  3822          }
  3823        }
  3824      }
  3825    }
  3826    nestedNonMonotonic: {
  3827      incomplete: {
  3828        b: {
  3829          n2: {
  3830            p1: {
  3831              x: ({
  3832                a: {
  3833                  b: 〈import;struct〉.MinFields(3)
  3834                }
  3835              }|null)
  3836              x: ({
  3837                a: {
  3838                  b: {
  3839                    c: 1
  3840                  }
  3841                }
  3842              }|null)
  3843              x: ({
  3844                a: {
  3845                  b: {
  3846                    d: 1
  3847                  }
  3848                }
  3849              }|null)
  3850            }
  3851          }
  3852        }
  3853      }
  3854    }
  3855    nestedNonMonotonic: {
  3856      incomplete: {
  3857        b: {
  3858          n2: {
  3859            p1: {
  3860              x: ({
  3861                a: {
  3862                  b: {
  3863                    c: 1
  3864                  }
  3865                }
  3866              }|null)
  3867              x: ({
  3868                a: {
  3869                  b: 〈import;struct〉.MinFields(3)
  3870                }
  3871              }|null)
  3872              x: ({
  3873                a: {
  3874                  b: {
  3875                    d: 1
  3876                  }
  3877                }
  3878              }|null)
  3879            }
  3880          }
  3881        }
  3882      }
  3883    }
  3884    nestedNonMonotonic: {
  3885      incomplete: {
  3886        b: {
  3887          n2: {
  3888            p1: {
  3889              x: ({
  3890                a: {
  3891                  b: {
  3892                    c: 1
  3893                  }
  3894                }
  3895              }|null)
  3896              x: ({
  3897                a: {
  3898                  b: {
  3899                    d: 1
  3900                  }
  3901                }
  3902              }|null)
  3903              x: ({
  3904                a: {
  3905                  b: 〈import;struct〉.MinFields(3)
  3906                }
  3907              }|null)
  3908            }
  3909          }
  3910        }
  3911      }
  3912    }
  3913    preserveClosedness: {
  3914      small: {
  3915        p1: {
  3916          #A: (〈0;#B〉 & {
  3917            a: string
  3918          })
  3919          #B: {
  3920            (*{}|{
  3921              a: string
  3922            })
  3923            (*{}|{
  3924              b: int
  3925            })
  3926          }
  3927        }
  3928      }
  3929    }
  3930    preserveClosedness: {
  3931      small: {
  3932        p2: {
  3933          #A: (〈0;#B〉 & {
  3934            a: string
  3935          })
  3936          #B: {
  3937            ({
  3938              a: string
  3939            }|*{})
  3940            (*{}|{
  3941              b: int
  3942            })
  3943          }
  3944        }
  3945      }
  3946    }
  3947    preserveClosedness: {
  3948      medium: {
  3949        p1: {
  3950          #A: (〈0;#B〉 & {
  3951            a: string
  3952          })
  3953          #B: {
  3954            (*{}|{
  3955              a: string
  3956            }|{
  3957              b: string
  3958            })
  3959            (*{}|{
  3960              c: int
  3961            }|{
  3962              d: string
  3963            })
  3964          }
  3965        }
  3966      }
  3967    }
  3968    preserveClosedness: {
  3969      medium: {
  3970        p2: {
  3971          #A: (〈0;#B〉 & {
  3972            a: string
  3973          })
  3974          #B: {
  3975            ({
  3976              a: string
  3977            }|*{}|{
  3978              b: string
  3979            })
  3980            (*{}|{
  3981              c: int
  3982            }|{
  3983              d: string
  3984            })
  3985          }
  3986        }
  3987      }
  3988    }
  3989    preserveClosedness: {
  3990      medium: {
  3991        p3: {
  3992          #A: (〈0;#B〉 & {
  3993            a: string
  3994          })
  3995          #B: {
  3996            ({
  3997              a: string
  3998            }|{
  3999              b: string
  4000            }|*{})
  4001            (*{}|{
  4002              c: int
  4003            }|{
  4004              d: string
  4005            })
  4006          }
  4007        }
  4008      }
  4009    }
  4010    noChildError: _
  4011    noChildError: {
  4012      issue1608: {
  4013        myValue: (〈0;#type〉 & {
  4014          fieldName: "some string"
  4015        })
  4016        #type: {
  4017          fieldName: 〈1;#subtype〉
  4018        }
  4019        #subtype: (string|{
  4020          foo: string
  4021        }|{
  4022          bar: 〈1;#subtype〉
  4023        })
  4024      }
  4025    }
  4026    noChildError: {
  4027      t1: {
  4028        #D: ({
  4029          b: string
  4030        }|{
  4031          c: 〈1;#D〉
  4032        })
  4033        o: (〈0;#D〉 & {
  4034          b: "test"
  4035        })
  4036      }
  4037    }
  4038    noChildError: {
  4039      t2: {
  4040        o: (〈0;#D〉 & {
  4041          b: "test"
  4042        })
  4043        #D: ({
  4044          b: string
  4045        }|{
  4046          c: 〈1;#D〉
  4047        })
  4048      }
  4049    }
  4050    noChildError: {
  4051      t3: {
  4052        #D: ({
  4053          a: null
  4054        }|{
  4055          b: string
  4056        }|{
  4057          c: 〈1;#D〉
  4058        })
  4059        o: (〈0;#D〉 & {
  4060          b: "test"
  4061        })
  4062      }
  4063    }
  4064    noChildError: {
  4065      t4: {
  4066        o: (〈0;#D〉 & {
  4067          b: "test"
  4068        })
  4069        #D: ({
  4070          a: null
  4071        }|{
  4072          b: string
  4073        }|{
  4074          c: 〈1;#D〉
  4075        })
  4076      }
  4077    }
  4078    issue1924: {
  4079      t1: {
  4080        m: {
  4081          a: 2
  4082        }
  4083        x: (*[
  4084          〈1;m〉.b,
  4085        ]|2)
  4086      }
  4087    }
  4088    issue1924: {
  4089      t2: {
  4090        m: {
  4091          a: 2
  4092        }
  4093        x: (*{
  4094          v: 〈1;m〉.b
  4095        }|3)
  4096      }
  4097    }
  4098    issue1924: {
  4099      t3: {
  4100        m: {
  4101          a: 2
  4102        }
  4103        x: (*〈0;m〉.b|1)
  4104      }
  4105    }
  4106    issue1838: {
  4107      t1: {
  4108        p?: []
  4109        a: ([
  4110          for _, k in 〈1;p〉 {
  4111            〈1;k〉
  4112          },
  4113        ]|null)
  4114      }
  4115    }
  4116    issue1838: {
  4117      t2: {
  4118        p?: []
  4119        a: (null|[
  4120          for _, k in 〈1;p〉 {
  4121            〈1;k〉
  4122          },
  4123        ])
  4124      }
  4125    }
  4126    noHang: {
  4127      #T: ([
  4128        "a",
  4129        〈1;#T〉,
  4130      ]|[
  4131        "d",
  4132        ...〈1;#T〉,
  4133      ])
  4134      x: 〈0;#T〉
  4135      #X: 〈0;x〉
  4136      #X: 〈0;#T〉
  4137    }
  4138    issue1940: {
  4139      #T: ([
  4140        "a",
  4141        〈1;#T〉,
  4142      ]|[
  4143        "b",
  4144        〈1;#T〉,
  4145      ]|[
  4146        "c",
  4147        〈1;#T〉,
  4148      ]|[
  4149        "d",
  4150        [
  4151          ...〈2;#T〉,
  4152        ],
  4153      ])
  4154      #A: {
  4155        type: 〈1;#T〉
  4156      }
  4157      #B: {
  4158        [string]: 〈1;#A〉
  4159      }
  4160      #C: (〈0;#B〉 & {
  4161        x: 〈1;#A〉
  4162      })
  4163    }
  4164  }
  4165  --- issue1417.cue
  4166  {
  4167    issue1417: {
  4168      #ID: (!~"^a"|=~"^ab$"|=~"^aB$")
  4169      #ID: (=~"^a"|!~"[A-Z]")
  4170      ids: ([
  4171        ...〈1;#ID〉,
  4172      ] & [
  4173        "xyz",
  4174        "ab",
  4175        "aB",
  4176      ])
  4177    }
  4178  }
  4179  --- issue2209full.cue
  4180  {
  4181    issue2209: {
  4182      simplified: {
  4183        t1: {
  4184          #SpecFoo: {
  4185            foo: {
  4186              min: 1
  4187            }
  4188          }
  4189          #SpecBar: {
  4190            bar: {
  4191              min: 1
  4192            }
  4193          }
  4194          spec: {
  4195            bar: {}
  4196          }
  4197          spec: (〈0;#SpecFoo〉|〈0;#SpecBar〉)
  4198          out: {
  4199            ({
  4200              nullFoo: null
  4201            }|{
  4202              nullBar: null
  4203            })
  4204            ({
  4205              minFoo: int
  4206            }|{
  4207              minBar: int
  4208            })
  4209            if (〈0;X〉.bar != _|_(explicit error (_|_ literal) in source)) {
  4210              minBar: 〈1;X〉.bar.min
  4211            }
  4212            X: 〈1;spec〉
  4213          }
  4214        }
  4215      }
  4216    }
  4217    issue2209: {
  4218      simplified: {
  4219        t2: {
  4220          #SpecFoo: {
  4221            foo: {}
  4222          }
  4223          #SpecBar: {
  4224            bar: {
  4225              x: 1
  4226            }
  4227          }
  4228          spec: {
  4229            bar: {}
  4230          }
  4231          spec: (*〈0;#SpecFoo〉|〈0;#SpecBar〉)
  4232          if (〈0;spec〉.bar != _|_(explicit error (_|_ literal) in source)) {
  4233            BAZ: 〈1;spec〉.bar.x
  4234          }
  4235          ({
  4236            f1: int
  4237          }|{
  4238            b2: int
  4239          })
  4240          ({
  4241            f2: int
  4242          }|{
  4243            b2: int
  4244          })
  4245        }
  4246      }
  4247    }
  4248    issue2209: {
  4249      simplified: {
  4250        t3: {
  4251          #A: {
  4252            v: 1
  4253          }
  4254          ({
  4255            f1: int
  4256          }|{
  4257            b2: int
  4258          })
  4259          ({
  4260            f2: int
  4261          }|{
  4262            b2: int
  4263          })
  4264          BAZ: 〈0;S〉.y
  4265          S: (*〈0;#A〉|〈0;#B〉)
  4266          #B: {
  4267            x: 1
  4268            y: 1
  4269          }
  4270          S: {
  4271            x: 1
  4272          }
  4273        }
  4274      }
  4275    }
  4276    issue2209: {
  4277      full: {
  4278        Foo: (〈0;#Abstract〉 & {
  4279          spec: {
  4280            foo: {}
  4281          }
  4282        })
  4283        Bar: (〈0;#Abstract〉 & {
  4284          spec: {
  4285            bar: {}
  4286          }
  4287        })
  4288        #Abstract: {
  4289          spec: 〈1;_#Spec〉
  4290          resource: (〈1;_Thing〉 & {
  4291            _X: {
  4292              spec: 〈3〉.spec
  4293            }
  4294          })
  4295        }
  4296        _#Spec: (*〈0;_#SpecFoo〉|〈0;_#SpecBar〉)
  4297        _#SpecFoo: {
  4298          foo: {
  4299            min: (int|*10)
  4300            max: (int|*20)
  4301          }
  4302        }
  4303        _#SpecBar: {
  4304          bar: {
  4305            min: (int|*30)
  4306            max: (int|*40)
  4307          }
  4308        }
  4309        _Thing: (〈0;#Constrained〉 & {
  4310          _X: _
  4311          spec: {
  4312            if (〈1;_X〉.spec.foo != _|_(explicit error (_|_ literal) in source)) {
  4313              minFoo: 〈2;_X〉.spec.foo.min
  4314              maxFoo: 〈2;_X〉.spec.foo.max
  4315            }
  4316            if (〈1;_X〉.spec.bar != _|_(explicit error (_|_ literal) in source)) {
  4317              minBar: 〈2;_X〉.spec.bar.min
  4318              maxBar: 〈2;_X〉.spec.bar.max
  4319            }
  4320          }
  4321        })
  4322        #Constrained: (〈0;#Base〉 & {
  4323          spec: ({
  4324            minFoo: (int|*10)
  4325            maxFoo: (int|*20)
  4326            minBar?: null
  4327            maxBar?: null
  4328          }|{
  4329            minBar: (int|*30)
  4330            maxBar: (int|*40)
  4331            minFoo?: null
  4332            maxFoo?: null
  4333          })
  4334          spec: (*{
  4335            fuga?: null
  4336          }|{
  4337            hoge?: null
  4338          })
  4339        })
  4340        #Base: {
  4341          spec: {
  4342            minFoo?: (null|int)
  4343            maxFoo?: (null|int)
  4344            minBar?: (null|int)
  4345            maxBar?: (null|int)
  4346            hoge?: (null|bool)
  4347            fuga?: (null|bool)
  4348          }
  4349        }
  4350      }
  4351    }
  4352  }
  4353  --- issue2246.cue
  4354  {
  4355    issue2246: {
  4356      simplified: {
  4357        #FormFoo: {
  4358          fooID: string
  4359        }
  4360        #FormBar: {
  4361          barID: string
  4362        }
  4363        #Form: {
  4364          (〈1;#FormFoo〉|〈1;#FormBar〉)
  4365        }
  4366        data: {
  4367          fooID: "123"
  4368        }
  4369        out1: (〈0;#Form〉 & 〈0;data〉)
  4370        out2: (〈0;#Form〉 & 〈0;out1〉)
  4371      }
  4372    }
  4373    issue2246: {
  4374      full: {
  4375        data: {
  4376          forms: [
  4377            {
  4378              fooID: "00-0000001"
  4379            },
  4380          ]
  4381        }
  4382        form1040: (〈0;#compute〉 & {
  4383          in: 〈1;data〉
  4384        }).out
  4385        #K1: {
  4386          #_base: {
  4387            common: 3
  4388          }
  4389          #FormFoo: {
  4390            〈1;#_base〉
  4391            fooID: string
  4392          }
  4393          #FormBar: {
  4394            〈1;#_base〉
  4395            barID: string
  4396          }
  4397          #Form: {
  4398            (〈1;#FormFoo〉|〈1;#FormBar〉)
  4399          }
  4400        }
  4401        #Input: {
  4402          forms: [
  4403            ...〈2;#K1〉.#Form,
  4404          ]
  4405        }
  4406        #summarizeReturn: {
  4407          in: 〈1;#Input〉
  4408          out: [
  4409            for _, k in 〈1;in〉.forms {
  4410              〈1;k〉.common
  4411            },
  4412          ]
  4413        }
  4414        #compute: {
  4415          in: 〈1;#Input〉
  4416          out: (〈1;#summarizeReturn〉 & {
  4417            in: 〈1;in〉
  4418          }).out
  4419        }
  4420      }
  4421    }
  4422  }
  4423  --- issue2263.cue
  4424  {
  4425    issue2263: {
  4426      simplified: {
  4427        metrics: 〈0;#Metric〉
  4428        #Metric: {
  4429          (〈1;#IDSource〉|{})
  4430          (〈1;#TargetAverage〉|{})
  4431        }
  4432        metrics: {
  4433          id: "foo"
  4434          avg: 60
  4435        }
  4436        #IDSource: {
  4437          id: string
  4438        }
  4439        #TargetAverage: {
  4440          avg: number
  4441        }
  4442      }
  4443    }
  4444    issue2263: {
  4445      full: {
  4446        metrics: [
  4447          ...〈1;#Metric〉,
  4448        ]
  4449        metrics: [
  4450          {
  4451            id: "foo"
  4452            avg: 60
  4453          },
  4454          {
  4455            id: "bar"
  4456            value: 80
  4457          },
  4458          {
  4459            uri: "baz"
  4460            avg: 70
  4461          },
  4462          {
  4463            uri: "qux"
  4464            value: 90
  4465          },
  4466        ]
  4467        #Metric: {
  4468          〈1;#Source〉
  4469          〈1;#Target〉
  4470        }
  4471        #Source: (〈0;#IDSource〉|〈0;#URISource〉)
  4472        #Target: (〈0;#TargetAverage〉|〈0;#TargetValue〉)
  4473        #IDSource: {
  4474          id: string
  4475        }
  4476        #URISource: {
  4477          uri: string
  4478        }
  4479        #TargetAverage: {
  4480          avg: number
  4481        }
  4482        #TargetValue: {
  4483          value: number
  4484        }
  4485      }
  4486    }
  4487  }
  4488  --- issue3149.cue
  4489  {
  4490    issue3149: {
  4491      #valid: {
  4492        name!: ((=~"^Foo"|"an exception") & (=~"Foo$"|"an exception"))
  4493      }
  4494      list: [
  4495        ...〈1;#valid〉,
  4496      ]
  4497      list: [
  4498        {
  4499          name: "FooBarFoo"
  4500        },
  4501        {
  4502          name: "FooBazFoo"
  4503        },
  4504        {
  4505          name: "FooQuuxFoo"
  4506        },
  4507        {
  4508          name: "an exception"
  4509        },
  4510      ]
  4511    }
  4512  }
  4513  --- issue770.cue
  4514  {
  4515    issue770: {
  4516      #A: {
  4517        v: ("a"|"b"|"c")
  4518      }
  4519      h: {
  4520        [string]: 〈1;#A〉
  4521      }
  4522      h: {
  4523        a: {
  4524          v: (*"a"|string)
  4525        }
  4526      }
  4527      h: {
  4528        [=~"^b"]: {
  4529          v: (*〈2;h〉.a.v|string)
  4530        }
  4531      }
  4532      h: {
  4533        [=~"^c"]: {
  4534          v: (*〈2;h〉.b.v|string)
  4535        }
  4536      }
  4537      h: {
  4538        b: _
  4539      }
  4540      h: {
  4541        boo: _
  4542      }
  4543      h: {
  4544        c: _
  4545      }
  4546      h: {
  4547        coo: _
  4548      }
  4549    }
  4550  }