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

     1  -- x.cue --
     2  // variants of fib
     3  
     4  inline: small: {
     5  	f: {
     6  		n: int
     7  		out: (f & {"n": n - 1}).out
     8  	}
     9  }
    10  
    11  inline: medium: {
    12  	f2:  (f & {n: 2}).out
    13  	fRec: {nn: int, out: (f & {n: nn}).out}
    14  	f: {
    15  		n: int
    16  		out: (fRec & {nn: n - 1}).out
    17  	}
    18  }
    19  
    20  inline: patterns: {
    21  	f: n: (f & {n: {}}).n
    22  	f: n: {}
    23  	[string]: {n: {}}
    24  	f: [string]: {}
    25  	f: {}
    26  }
    27  
    28  inline: acrossFields: fail1: {
    29  	f: {
    30  		in:  number
    31  		out: in + 1
    32  	}
    33  	k00: 0
    34  	k10: (f & {in: k00}).out
    35  	k20: (f & {in: k10}).out
    36  	k30: (f & {in: k20}).out
    37  
    38  	// invalid recursion is here.
    39  	k10: (f & {in: k30}).out
    40  }
    41  
    42  // Issue #2163
    43  inline: acrossFields: ok1: {
    44  	f: {
    45  		in:  number
    46  		out: in
    47  	}
    48  	k00: 0
    49  	k10: (f & {in: k00}).out
    50  	k20: (f & {in: k10}).out
    51  	k30: (f & {in: k20}).out
    52  
    53  	// TODO: what is correct behavior here.
    54  	// This is borderline okay.
    55  	k10: (f & {in: k30}).out
    56  }
    57  -- inlineexpand.cue --
    58  inlined: {
    59  	X: {
    60  		input: a: _
    61  		output: input.a
    62  	}
    63  	root: a: (X & {input: root}).output
    64  }
    65  expanded1: hasCycle: {
    66  	X: {
    67  		input: a: _
    68  		output: input.a
    69  	}
    70  	root: {
    71  		a: _a.output
    72  		_a: X & {input: root}
    73  	}
    74  }
    75  expanded2: noCycle: {
    76  	X: {
    77  		input: a: _
    78  		output: input.a
    79  	}
    80  	root: a: _a.output
    81  	_a: X & {input: root}
    82  }
    83  issue3731: reduced: {
    84  	#lookup: {
    85  		input: {...}
    86  		output: [
    87  			for _, v in input if v.show != _|_ { v },
    88  		]
    89  	}
    90  
    91  	root: {
    92  		self: show: true
    93  		others: (#lookup & {input: root}).output
    94  	}
    95  }
    96  issue3731: expanded: {
    97  	#lookup: {
    98  		input: {...}
    99  		output: [
   100  			for _, v in input if v.show != _|_ { v },
   101  		]
   102  	}
   103  
   104  	root: {
   105  		self: show: true
   106  		others: _others.output
   107  		_others: #lookup & {input: root}
   108  	}
   109  }
   110  issue3731: full: {
   111  	#Workspace: {
   112  		workspaceA?: {}
   113  		workspaceB?: {}
   114  	}
   115  
   116  	#AccountConfig: {
   117  		workspaces: #Workspace
   118  		siblings?: [...string]
   119  	}
   120  
   121  	#AccountConfigSub1: {
   122  		#AccountConfig
   123  		workspaces: "workspaceA": {}
   124  	}
   125  	
   126  	#AccountConfigSub2: {
   127  		#AccountConfig
   128  		workspaces: "workspaceB": {}
   129  	}
   130  	
   131  	tree: env1: {
   132  		"region1": {
   133  			"env1-r1-account-sub1": #AccountConfigSub1
   134  			"env1-r1-account-sub2-1": #AccountConfigSub2
   135  		}
   136  	}
   137  	
   138  	#lookupSiblings: {
   139  		envtree: {...}
   140  		out: [
   141  			for region, v in envtree
   142  			for account, config in v
   143  			if config.workspaces."workspaceB" != _|_ { account },
   144  		]
   145  	}
   146  	
   147  	tree: ENVTREE=env1: [_]: [_]: #AccountConfig & {
   148  		siblings: (#lookupSiblings & {envtree: ENVTREE}).out
   149  	}
   150  }
   151  -- out/compile --
   152  --- inlineexpand.cue
   153  {
   154    inlined: {
   155      X: {
   156        input: {
   157          a: _
   158        }
   159        output: 〈0;input〉.a
   160      }
   161      root: {
   162        a: (〈1;X〉 & {
   163          input: 〈2;root〉
   164        }).output
   165      }
   166    }
   167    expanded1: {
   168      hasCycle: {
   169        X: {
   170          input: {
   171            a: _
   172          }
   173          output: 〈0;input〉.a
   174        }
   175        root: {
   176          a: 〈0;_a〉.output
   177          _a: (〈1;X〉 & {
   178            input: 〈2;root〉
   179          })
   180        }
   181      }
   182    }
   183    expanded2: {
   184      noCycle: {
   185        X: {
   186          input: {
   187            a: _
   188          }
   189          output: 〈0;input〉.a
   190        }
   191        root: {
   192          a: 〈1;_a〉.output
   193        }
   194        _a: (〈0;X〉 & {
   195          input: 〈1;root〉
   196        })
   197      }
   198    }
   199    issue3731: {
   200      reduced: {
   201        #lookup: {
   202          input: {
   203            ...
   204          }
   205          output: [
   206            for _, v in 〈1;input〉 if (〈0;v〉.show != _|_(explicit error (_|_ literal) in source)) {
   207              〈1;v〉
   208            },
   209          ]
   210        }
   211        root: {
   212          self: {
   213            show: true
   214          }
   215          others: (〈1;#lookup〉 & {
   216            input: 〈2;root〉
   217          }).output
   218        }
   219      }
   220    }
   221    issue3731: {
   222      expanded: {
   223        #lookup: {
   224          input: {
   225            ...
   226          }
   227          output: [
   228            for _, v in 〈1;input〉 if (〈0;v〉.show != _|_(explicit error (_|_ literal) in source)) {
   229              〈1;v〉
   230            },
   231          ]
   232        }
   233        root: {
   234          self: {
   235            show: true
   236          }
   237          others: 〈0;_others〉.output
   238          _others: (〈1;#lookup〉 & {
   239            input: 〈2;root〉
   240          })
   241        }
   242      }
   243    }
   244    issue3731: {
   245      full: {
   246        #Workspace: {
   247          workspaceA?: {}
   248          workspaceB?: {}
   249        }
   250        #AccountConfig: {
   251          workspaces: 〈1;#Workspace〉
   252          siblings?: [
   253            ...string,
   254          ]
   255        }
   256        #AccountConfigSub1: {
   257          〈1;#AccountConfig〉
   258          workspaces: {
   259            workspaceA: {}
   260          }
   261        }
   262        #AccountConfigSub2: {
   263          〈1;#AccountConfig〉
   264          workspaces: {
   265            workspaceB: {}
   266          }
   267        }
   268        tree: {
   269          env1: {
   270            region1: {
   271              "env1-r1-account-sub1": 〈3;#AccountConfigSub1〉
   272              "env1-r1-account-sub2-1": 〈3;#AccountConfigSub2〉
   273            }
   274          }
   275        }
   276        #lookupSiblings: {
   277          envtree: {
   278            ...
   279          }
   280          out: [
   281            for region, v in 〈1;envtree〉 for account, config in 〈0;v〉 if (〈0;config〉.workspaces.workspaceB != _|_(explicit error (_|_ literal) in source)) {
   282              〈1;account〉
   283            },
   284          ]
   285        }
   286        tree: {
   287          env1: {
   288            [_]: {
   289              [_]: (〈3;#AccountConfig〉 & {
   290                siblings: (〈4;#lookupSiblings〉 & {
   291                  envtree: 〈4;env1〉
   292                }).out
   293              })
   294            }
   295          }
   296        }
   297      }
   298    }
   299  }
   300  --- x.cue
   301  {
   302    inline: {
   303      small: {
   304        f: {
   305          n: int
   306          out: (〈1;f〉 & {
   307            n: (〈1;n〉 - 1)
   308          }).out
   309        }
   310      }
   311    }
   312    inline: {
   313      medium: {
   314        f2: (〈0;f〉 & {
   315          n: 2
   316        }).out
   317        fRec: {
   318          nn: int
   319          out: (〈1;f〉 & {
   320            n: 〈1;nn〉
   321          }).out
   322        }
   323        f: {
   324          n: int
   325          out: (〈1;fRec〉 & {
   326            nn: (〈1;n〉 - 1)
   327          }).out
   328        }
   329      }
   330    }
   331    inline: {
   332      patterns: {
   333        f: {
   334          n: (〈1;f〉 & {
   335            n: {}
   336          }).n
   337        }
   338        f: {
   339          n: {}
   340        }
   341        [string]: {
   342          n: {}
   343        }
   344        f: {
   345          [string]: {}
   346        }
   347        f: {}
   348      }
   349    }
   350    inline: {
   351      acrossFields: {
   352        fail1: {
   353          f: {
   354            in: number
   355            out: (〈0;in〉 + 1)
   356          }
   357          k00: 0
   358          k10: (〈0;f〉 & {
   359            in: 〈1;k00〉
   360          }).out
   361          k20: (〈0;f〉 & {
   362            in: 〈1;k10〉
   363          }).out
   364          k30: (〈0;f〉 & {
   365            in: 〈1;k20〉
   366          }).out
   367          k10: (〈0;f〉 & {
   368            in: 〈1;k30〉
   369          }).out
   370        }
   371      }
   372    }
   373    inline: {
   374      acrossFields: {
   375        ok1: {
   376          f: {
   377            in: number
   378            out: 〈0;in〉
   379          }
   380          k00: 0
   381          k10: (〈0;f〉 & {
   382            in: 〈1;k00〉
   383          }).out
   384          k20: (〈0;f〉 & {
   385            in: 〈1;k10〉
   386          }).out
   387          k30: (〈0;f〉 & {
   388            in: 〈1;k20〉
   389          }).out
   390          k10: (〈0;f〉 & {
   391            in: 〈1;k30〉
   392          }).out
   393        }
   394      }
   395    }
   396  }
   397  -- out/evalalpha/stats --
   398  Leaks:  344
   399  Freed:  0
   400  Reused: 0
   401  Allocs: 344
   402  Retain: 0
   403  
   404  Unifications: 269
   405  Conjuncts:    675
   406  Disjuncts:    0
   407  
   408  CloseIDElems: 329
   409  NumCloseIDs: 233
   410  -- diff/-out/evalalpha/stats<==>+out/eval/stats --
   411  diff old new
   412  --- old
   413  +++ new
   414  @@ -1,9 +1,12 @@
   415  -Leaks:  286
   416  -Freed:  253
   417  -Reused: 248
   418  -Allocs: 291
   419  -Retain: 994
   420  -
   421  -Unifications: 539
   422  -Conjuncts:    1663
   423  -Disjuncts:    943
   424  +Leaks:  344
   425  +Freed:  0
   426  +Reused: 0
   427  +Allocs: 344
   428  +Retain: 0
   429  +
   430  +Unifications: 269
   431  +Conjuncts:    675
   432  +Disjuncts:    0
   433  +
   434  +CloseIDElems: 329
   435  +NumCloseIDs: 233
   436  -- out/eval/stats --
   437  Leaks:  286
   438  Freed:  253
   439  Reused: 248
   440  Allocs: 291
   441  Retain: 994
   442  
   443  Unifications: 539
   444  Conjuncts:    1663
   445  Disjuncts:    943
   446  -- out/eval --
   447  Errors:
   448  expanded1.hasCycle.root._a.input._a.input: structural cycle:
   449      ./inlineexpand.cue:11:11
   450  issue3731.expanded.root._others.input._others.input: structural cycle:
   451      ./inlineexpand.cue:43:16
   452  structural cycle:
   453      ./x.cue:6:9
   454  structural cycle:
   455      ./x.cue:15:9
   456  structural cycle:
   457      ./x.cue:20:9
   458  in: structural cycle:
   459      ./x.cue:30:8
   460  
   461  Result:
   462  (_|_){
   463    // [structural cycle]
   464    inlined: (struct){
   465      X: (struct){
   466        input: (struct){
   467          a: (_){ _ }
   468        }
   469        output: (_){ _ }
   470      }
   471      root: (struct){
   472        a: (_){ _ }
   473      }
   474    }
   475    expanded1: (_|_){
   476      // [structural cycle]
   477      hasCycle: (_|_){
   478        // [structural cycle]
   479        X: (struct){
   480          input: (struct){
   481            a: (_){ _ }
   482          }
   483          output: (_){ _ }
   484        }
   485        root: (_|_){
   486          // [structural cycle]
   487          a: (_){ _ }
   488          _a: (_|_){
   489            // [structural cycle]
   490            input: (_|_){
   491              // [structural cycle]
   492              a: (_|_){
   493                // [structural cycle] expanded1.hasCycle.root._a.input._a.input: structural cycle:
   494                //     ./inlineexpand.cue:11:11
   495              }
   496              _a: (_|_){
   497                // [structural cycle]
   498                input: (_|_){
   499                  // [structural cycle] expanded1.hasCycle.root._a.input._a.input: structural cycle:
   500                  //     ./inlineexpand.cue:11:11
   501                }
   502                output: (_|_){
   503                  // [structural cycle] expanded1.hasCycle.root._a.input._a.input: structural cycle:
   504                  //     ./inlineexpand.cue:11:11
   505                }
   506              }
   507            }
   508            output: (_|_){
   509              // [structural cycle] expanded1.hasCycle.root._a.input._a.input: structural cycle:
   510              //     ./inlineexpand.cue:11:11
   511            }
   512          }
   513        }
   514      }
   515    }
   516    expanded2: (struct){
   517      noCycle: (struct){
   518        X: (struct){
   519          input: (struct){
   520            a: (_){ _ }
   521          }
   522          output: (_){ _ }
   523        }
   524        root: (struct){
   525          a: (_){ _ }
   526        }
   527        _a: (struct){
   528          input: (struct){
   529            a: (_){ _ }
   530          }
   531          output: (_){ _ }
   532        }
   533      }
   534    }
   535    issue3731: (_|_){
   536      // [structural cycle]
   537      reduced: (struct){
   538        #lookup: (#struct){
   539          input: (#struct){
   540          }
   541          output: (#list){
   542          }
   543        }
   544        root: (struct){
   545          self: (struct){
   546            show: (bool){ true }
   547          }
   548          others: (#list){
   549            0: (struct){
   550              show: (bool){ true }
   551            }
   552          }
   553        }
   554      }
   555      expanded: (_|_){
   556        // [structural cycle]
   557        #lookup: (#struct){
   558          input: (#struct){
   559          }
   560          output: (#list){
   561          }
   562        }
   563        root: (_|_){
   564          // [structural cycle]
   565          self: (struct){
   566            show: (bool){ true }
   567          }
   568          others: (#list){
   569            0: (struct){
   570              show: (bool){ true }
   571            }
   572          }
   573          _others: (_|_){
   574            // [structural cycle]
   575            input: (_|_){
   576              // [structural cycle]
   577              self: (struct){
   578                show: (bool){ true }
   579              }
   580              others: (_|_){
   581                // [structural cycle] issue3731.expanded.root._others.input._others.input: structural cycle:
   582                //     ./inlineexpand.cue:43:16
   583              }
   584              _others: (_|_){
   585                // [structural cycle]
   586                input: (_|_){
   587                  // [structural cycle] issue3731.expanded.root._others.input._others.input: structural cycle:
   588                  //     ./inlineexpand.cue:43:16
   589                }
   590                output: (_|_){
   591                  // [structural cycle] issue3731.expanded.root._others.input._others.input: structural cycle:
   592                  //     ./inlineexpand.cue:43:16
   593                }
   594              }
   595            }
   596            output: (#list){
   597              0: (#struct){
   598                show: (bool){ true }
   599              }
   600            }
   601          }
   602        }
   603      }
   604      full: (struct){
   605        #Workspace: (#struct){
   606          workspaceA?: (#struct){
   607          }
   608          workspaceB?: (#struct){
   609          }
   610        }
   611        #AccountConfig: (#struct){
   612          workspaces: (#struct){
   613            workspaceA?: (#struct){
   614            }
   615            workspaceB?: (#struct){
   616            }
   617          }
   618          siblings?: (list){
   619          }
   620        }
   621        #AccountConfigSub1: (#struct){
   622          workspaces: (#struct){
   623            workspaceA: (#struct){
   624            }
   625            workspaceB?: (#struct){
   626            }
   627          }
   628          siblings?: (list){
   629          }
   630        }
   631        #AccountConfigSub2: (#struct){
   632          workspaces: (#struct){
   633            workspaceA?: (#struct){
   634            }
   635            workspaceB: (#struct){
   636            }
   637          }
   638          siblings?: (list){
   639          }
   640        }
   641        tree: (struct){
   642          env1: (struct){
   643            region1: (struct){
   644              "env1-r1-account-sub1": (#struct){
   645                workspaces: (#struct){
   646                  workspaceA: (#struct){
   647                  }
   648                  workspaceB?: (#struct){
   649                  }
   650                }
   651                siblings: (#list){
   652                  0: (string){ "env1-r1-account-sub2-1" }
   653                }
   654              }
   655              "env1-r1-account-sub2-1": (#struct){
   656                workspaces: (#struct){
   657                  workspaceA?: (#struct){
   658                  }
   659                  workspaceB: (#struct){
   660                  }
   661                }
   662                siblings: (#list){
   663                  0: (string){ "env1-r1-account-sub2-1" }
   664                }
   665              }
   666            }
   667          }
   668        }
   669        #lookupSiblings: (#struct){
   670          envtree: (#struct){
   671          }
   672          out: (#list){
   673          }
   674        }
   675      }
   676    }
   677    inline: (_|_){
   678      // [structural cycle]
   679      small: (_|_){
   680        // [structural cycle]
   681        f: (_|_){
   682          // [structural cycle]
   683          n: (int){ int }
   684          out: (_|_){
   685            // [structural cycle] structural cycle:
   686            //     ./x.cue:6:9
   687          }
   688        }
   689      }
   690      medium: (_|_){
   691        // [structural cycle]
   692        f2: (_|_){
   693          // [structural cycle] structural cycle:
   694          //     ./x.cue:15:9
   695        }
   696        fRec: (_|_){
   697          // [structural cycle]
   698          nn: (int){ int }
   699          out: (_|_){
   700            // [structural cycle] structural cycle:
   701            //     ./x.cue:15:9
   702          }
   703        }
   704        f: (_|_){
   705          // [structural cycle]
   706          n: (int){ int }
   707          out: (_|_){
   708            // [structural cycle] structural cycle:
   709            //     ./x.cue:15:9
   710          }
   711        }
   712      }
   713      patterns: (_|_){
   714        // [structural cycle]
   715        f: (_|_){
   716          // [structural cycle]
   717          n: (_|_){
   718            // [structural cycle] structural cycle:
   719            //     ./x.cue:20:9
   720          }
   721        }
   722      }
   723      acrossFields: (_|_){
   724        // [structural cycle]
   725        fail1: (_|_){
   726          // [structural cycle]
   727          f: (struct){
   728            in: (number){ number }
   729            out: (_|_){
   730              // [incomplete] inline.acrossFields.fail1.f.out: non-concrete value number in operand to +:
   731              //     ./x.cue:30:8
   732              //     ./x.cue:29:8
   733            }
   734          }
   735          k00: (int){ 0 }
   736          k10: (_|_){
   737            // [structural cycle] in: structural cycle:
   738            //     ./x.cue:30:8
   739          }
   740          k20: (_|_){
   741            // [structural cycle] in: structural cycle:
   742            //     ./x.cue:30:8
   743          }
   744          k30: (_|_){
   745            // [structural cycle] in: structural cycle:
   746            //     ./x.cue:30:8
   747          }
   748        }
   749        ok1: (struct){
   750          f: (struct){
   751            in: (number){ number }
   752            out: (number){ number }
   753          }
   754          k00: (int){ 0 }
   755          k10: (int){ 0 }
   756          k20: (int){ 0 }
   757          k30: (int){ 0 }
   758        }
   759      }
   760    }
   761  }
   762  -- out/evalalpha --
   763  Errors:
   764  expanded1.hasCycle.root._a.input._a.input: structural cycle
   765  issue3731.expanded.root._others.input._others.input: structural cycle
   766  structural cycle:
   767      ./x.cue:6:9
   768  structural cycle:
   769      ./x.cue:12:24
   770  structural cycle:
   771      ./x.cue:15:9
   772  structural cycle:
   773      ./x.cue:20:9
   774  
   775  Result:
   776  (_|_){
   777    // [structural cycle]
   778    inlined: (struct){
   779      X: (struct){
   780        input: (struct){
   781          a: (_){ _ }
   782        }
   783        output: (_){ _ }
   784      }
   785      root: (struct){
   786        a: (_){ _ }
   787      }
   788    }
   789    expanded1: (_|_){
   790      // [structural cycle]
   791      hasCycle: (_|_){
   792        // [structural cycle]
   793        X: (struct){
   794          input: (struct){
   795            a: (_){ _ }
   796          }
   797          output: (_){ _ }
   798        }
   799        root: (_|_){
   800          // [structural cycle]
   801          a: (_){ _ }
   802          _a: (_|_){
   803            // [structural cycle]
   804            input: (_|_){
   805              // [structural cycle]
   806              a: (_){ _ }
   807              _a: (_|_){
   808                // [structural cycle]
   809                input: (_|_){
   810                  // [structural cycle] expanded1.hasCycle.root._a.input._a.input: structural cycle
   811                }
   812                output: (_|_){
   813                  // [structural cycle] expanded1.hasCycle.root._a.input._a.input: structural cycle
   814                }
   815              }
   816            }
   817            output: (_){ _ }
   818          }
   819        }
   820      }
   821    }
   822    expanded2: (struct){
   823      noCycle: (struct){
   824        X: (struct){
   825          input: (struct){
   826            a: (_){ _ }
   827          }
   828          output: (_){ _ }
   829        }
   830        root: (struct){
   831          a: (_){ _ }
   832        }
   833        _a: (struct){
   834          input: (struct){
   835            a: (_){ _ }
   836          }
   837          output: (_){ _ }
   838        }
   839      }
   840    }
   841    issue3731: (_|_){
   842      // [structural cycle]
   843      reduced: (struct){
   844        #lookup: (#struct){
   845          input: (#struct){
   846          }
   847          output: (#list){
   848          }
   849        }
   850        root: (struct){
   851          self: (struct){
   852            show: (bool){ true }
   853          }
   854          others: (#list){
   855            0: (#struct){
   856              show: (bool){ true }
   857            }
   858          }
   859        }
   860      }
   861      expanded: (_|_){
   862        // [structural cycle]
   863        #lookup: (#struct){
   864          input: (#struct){
   865          }
   866          output: (#list){
   867          }
   868        }
   869        root: (_|_){
   870          // [structural cycle]
   871          self: (struct){
   872            show: (bool){ true }
   873          }
   874          others: ~(issue3731.expanded.root._others.output)
   875          _others: (_|_){
   876            // [structural cycle]
   877            input: (_|_){
   878              // [structural cycle]
   879              self: (#struct){
   880                show: (bool){ true }
   881              }
   882              others: (#list){
   883              }
   884              _others: (_|_){
   885                // [structural cycle]
   886                input: (_|_){
   887                  // [structural cycle] issue3731.expanded.root._others.input._others.input: structural cycle
   888                }
   889                output: (#list){
   890                }
   891              }
   892            }
   893            output: (#list){
   894              0: (#struct){
   895                show: (bool){ true }
   896              }
   897            }
   898          }
   899        }
   900      }
   901      full: (struct){
   902        #Workspace: (#struct){
   903          workspaceA?: (#struct){
   904          }
   905          workspaceB?: (#struct){
   906          }
   907        }
   908        #AccountConfig: (#struct){
   909          workspaces: ~(issue3731.full.#Workspace)
   910          siblings?: (list){
   911          }
   912        }
   913        #AccountConfigSub1: (#struct){
   914          workspaces: (#struct){
   915            workspaceA: (#struct){
   916            }
   917            workspaceB?: (#struct){
   918            }
   919          }
   920          siblings?: (list){
   921          }
   922        }
   923        #AccountConfigSub2: (#struct){
   924          workspaces: (#struct){
   925            workspaceB: (#struct){
   926            }
   927            workspaceA?: (#struct){
   928            }
   929          }
   930          siblings?: (list){
   931          }
   932        }
   933        tree: (struct){
   934          env1: (struct){
   935            region1: (struct){
   936              "env1-r1-account-sub1": (#struct){
   937                siblings: (#list){
   938                  0: (string){ "env1-r1-account-sub2-1" }
   939                }
   940                workspaces: (#struct){
   941                  workspaceA: (#struct){
   942                  }
   943                  workspaceB?: (#struct){
   944                  }
   945                }
   946              }
   947              "env1-r1-account-sub2-1": (#struct){
   948                siblings: (#list){
   949                  0: (string){ "env1-r1-account-sub2-1" }
   950                }
   951                workspaces: (#struct){
   952                  workspaceB: (#struct){
   953                  }
   954                  workspaceA?: (#struct){
   955                  }
   956                }
   957              }
   958            }
   959          }
   960        }
   961        #lookupSiblings: (#struct){
   962          envtree: (#struct){
   963          }
   964          out: (#list){
   965          }
   966        }
   967      }
   968    }
   969    inline: (_|_){
   970      // [structural cycle]
   971      small: (_|_){
   972        // [structural cycle]
   973        f: (_|_){
   974          // [structural cycle]
   975          n: (int){ int }
   976          out: (_|_){
   977            // [structural cycle] structural cycle:
   978            //     ./x.cue:6:9
   979          }
   980        }
   981      }
   982      medium: (_|_){
   983        // [structural cycle]
   984        f2: (_|_){
   985          // [structural cycle] structural cycle:
   986          //     ./x.cue:12:24
   987        }
   988        fRec: (_|_){
   989          // [structural cycle]
   990          nn: (int){ int }
   991          out: (_|_){
   992            // [structural cycle] structural cycle:
   993            //     ./x.cue:15:9
   994          }
   995        }
   996        f: (_|_){
   997          // [structural cycle]
   998          n: (int){ int }
   999          out: (_|_){
  1000            // [structural cycle] structural cycle:
  1001            //     ./x.cue:15:9
  1002          }
  1003        }
  1004      }
  1005      patterns: (_|_){
  1006        // [structural cycle]
  1007        f: (_|_){
  1008          // [structural cycle]
  1009          n: (_|_){
  1010            // [structural cycle] structural cycle:
  1011            //     ./x.cue:20:9
  1012          }
  1013        }
  1014      }
  1015      acrossFields: (struct){
  1016        fail1: (struct){
  1017          f: (struct){
  1018            in: (number){ number }
  1019            out: (_|_){
  1020              // [incomplete] inline.acrossFields.fail1.f.out: non-concrete value number in operand to +:
  1021              //     ./x.cue:30:8
  1022              //     ./x.cue:29:8
  1023            }
  1024          }
  1025          k00: (int){ 0 }
  1026          k10: (_|_){
  1027            // [incomplete] in: non-concrete value number in operand to +:
  1028            //     ./x.cue:30:8
  1029            //     ./x.cue:29:8
  1030            //     ./x.cue:35:17
  1031          }
  1032          k20: (_|_){
  1033            // [incomplete] in: non-concrete value number in operand to +:
  1034            //     ./x.cue:30:8
  1035            //     ./x.cue:29:8
  1036            //     ./x.cue:38:17
  1037          }
  1038          k30: (_|_){
  1039            // [incomplete] in: non-concrete value number in operand to +:
  1040            //     ./x.cue:30:8
  1041            //     ./x.cue:29:8
  1042            //     ./x.cue:34:17
  1043          }
  1044        }
  1045        ok1: (struct){
  1046          f: (struct){
  1047            in: (number){ number }
  1048            out: (number){ number }
  1049          }
  1050          k00: (int){ 0 }
  1051          k10: (int){ 0 }
  1052          k20: (int){ 0 }
  1053          k30: (int){ 0 }
  1054        }
  1055      }
  1056    }
  1057  }
  1058  -- diff/-out/evalalpha<==>+out/eval --
  1059  diff old new
  1060  --- old
  1061  +++ new
  1062  @@ -1,16 +1,14 @@
  1063   Errors:
  1064  -expanded1.hasCycle.root._a.input._a.input: structural cycle:
  1065  -    ./inlineexpand.cue:11:11
  1066  -issue3731.expanded.root._others.input._others.input: structural cycle:
  1067  -    ./inlineexpand.cue:43:16
  1068  +expanded1.hasCycle.root._a.input._a.input: structural cycle
  1069  +issue3731.expanded.root._others.input._others.input: structural cycle
  1070   structural cycle:
  1071       ./x.cue:6:9
  1072   structural cycle:
  1073  +    ./x.cue:12:24
  1074  +structural cycle:
  1075       ./x.cue:15:9
  1076   structural cycle:
  1077       ./x.cue:20:9
  1078  -in: structural cycle:
  1079  -    ./x.cue:30:8
  1080   
  1081   Result:
  1082   (_|_){
  1083  @@ -43,26 +41,18 @@
  1084             // [structural cycle]
  1085             input: (_|_){
  1086               // [structural cycle]
  1087  -            a: (_|_){
  1088  -              // [structural cycle] expanded1.hasCycle.root._a.input._a.input: structural cycle:
  1089  -              //     ./inlineexpand.cue:11:11
  1090  -            }
  1091  +            a: (_){ _ }
  1092               _a: (_|_){
  1093                 // [structural cycle]
  1094                 input: (_|_){
  1095  -                // [structural cycle] expanded1.hasCycle.root._a.input._a.input: structural cycle:
  1096  -                //     ./inlineexpand.cue:11:11
  1097  -              }
  1098  -              output: (_|_){
  1099  -                // [structural cycle] expanded1.hasCycle.root._a.input._a.input: structural cycle:
  1100  -                //     ./inlineexpand.cue:11:11
  1101  -              }
  1102  -            }
  1103  -          }
  1104  -          output: (_|_){
  1105  -            // [structural cycle] expanded1.hasCycle.root._a.input._a.input: structural cycle:
  1106  -            //     ./inlineexpand.cue:11:11
  1107  -          }
  1108  +                // [structural cycle] expanded1.hasCycle.root._a.input._a.input: structural cycle
  1109  +              }
  1110  +              output: (_|_){
  1111  +                // [structural cycle] expanded1.hasCycle.root._a.input._a.input: structural cycle
  1112  +              }
  1113  +            }
  1114  +          }
  1115  +          output: (_){ _ }
  1116           }
  1117         }
  1118       }
  1119  @@ -100,7 +90,7 @@
  1120             show: (bool){ true }
  1121           }
  1122           others: (#list){
  1123  -          0: (struct){
  1124  +          0: (#struct){
  1125               show: (bool){ true }
  1126             }
  1127           }
  1128  @@ -119,31 +109,22 @@
  1129           self: (struct){
  1130             show: (bool){ true }
  1131           }
  1132  -        others: (#list){
  1133  -          0: (struct){
  1134  -            show: (bool){ true }
  1135  -          }
  1136  -        }
  1137  +        others: ~(issue3731.expanded.root._others.output)
  1138           _others: (_|_){
  1139             // [structural cycle]
  1140             input: (_|_){
  1141               // [structural cycle]
  1142  -            self: (struct){
  1143  -              show: (bool){ true }
  1144  -            }
  1145  -            others: (_|_){
  1146  -              // [structural cycle] issue3731.expanded.root._others.input._others.input: structural cycle:
  1147  -              //     ./inlineexpand.cue:43:16
  1148  +            self: (#struct){
  1149  +              show: (bool){ true }
  1150  +            }
  1151  +            others: (#list){
  1152               }
  1153               _others: (_|_){
  1154                 // [structural cycle]
  1155                 input: (_|_){
  1156  -                // [structural cycle] issue3731.expanded.root._others.input._others.input: structural cycle:
  1157  -                //     ./inlineexpand.cue:43:16
  1158  -              }
  1159  -              output: (_|_){
  1160  -                // [structural cycle] issue3731.expanded.root._others.input._others.input: structural cycle:
  1161  -                //     ./inlineexpand.cue:43:16
  1162  +                // [structural cycle] issue3731.expanded.root._others.input._others.input: structural cycle
  1163  +              }
  1164  +              output: (#list){
  1165                 }
  1166               }
  1167             }
  1168  @@ -163,12 +144,7 @@
  1169           }
  1170         }
  1171         #AccountConfig: (#struct){
  1172  -        workspaces: (#struct){
  1173  -          workspaceA?: (#struct){
  1174  -          }
  1175  -          workspaceB?: (#struct){
  1176  -          }
  1177  -        }
  1178  +        workspaces: ~(issue3731.full.#Workspace)
  1179           siblings?: (list){
  1180           }
  1181         }
  1182  @@ -184,10 +160,10 @@
  1183         }
  1184         #AccountConfigSub2: (#struct){
  1185           workspaces: (#struct){
  1186  -          workspaceA?: (#struct){
  1187  -          }
  1188             workspaceB: (#struct){
  1189             }
  1190  +          workspaceA?: (#struct){
  1191  +          }
  1192           }
  1193           siblings?: (list){
  1194           }
  1195  @@ -196,6 +172,9 @@
  1196           env1: (struct){
  1197             region1: (struct){
  1198               "env1-r1-account-sub1": (#struct){
  1199  +              siblings: (#list){
  1200  +                0: (string){ "env1-r1-account-sub2-1" }
  1201  +              }
  1202                 workspaces: (#struct){
  1203                   workspaceA: (#struct){
  1204                   }
  1205  @@ -202,19 +181,16 @@
  1206                   workspaceB?: (#struct){
  1207                   }
  1208                 }
  1209  -              siblings: (#list){
  1210  -                0: (string){ "env1-r1-account-sub2-1" }
  1211  -              }
  1212               }
  1213               "env1-r1-account-sub2-1": (#struct){
  1214  -              workspaces: (#struct){
  1215  -                workspaceA?: (#struct){
  1216  -                }
  1217  +              siblings: (#list){
  1218  +                0: (string){ "env1-r1-account-sub2-1" }
  1219  +              }
  1220  +              workspaces: (#struct){
  1221                   workspaceB: (#struct){
  1222                   }
  1223  -              }
  1224  -              siblings: (#list){
  1225  -                0: (string){ "env1-r1-account-sub2-1" }
  1226  +                workspaceA?: (#struct){
  1227  +                }
  1228                 }
  1229               }
  1230             }
  1231  @@ -245,7 +221,7 @@
  1232         // [structural cycle]
  1233         f2: (_|_){
  1234           // [structural cycle] structural cycle:
  1235  -        //     ./x.cue:15:9
  1236  +        //     ./x.cue:12:24
  1237         }
  1238         fRec: (_|_){
  1239           // [structural cycle]
  1240  @@ -274,10 +250,8 @@
  1241           }
  1242         }
  1243       }
  1244  -    acrossFields: (_|_){
  1245  -      // [structural cycle]
  1246  -      fail1: (_|_){
  1247  -        // [structural cycle]
  1248  +    acrossFields: (struct){
  1249  +      fail1: (struct){
  1250           f: (struct){
  1251             in: (number){ number }
  1252             out: (_|_){
  1253  @@ -288,16 +262,22 @@
  1254           }
  1255           k00: (int){ 0 }
  1256           k10: (_|_){
  1257  -          // [structural cycle] in: structural cycle:
  1258  -          //     ./x.cue:30:8
  1259  +          // [incomplete] in: non-concrete value number in operand to +:
  1260  +          //     ./x.cue:30:8
  1261  +          //     ./x.cue:29:8
  1262  +          //     ./x.cue:35:17
  1263           }
  1264           k20: (_|_){
  1265  -          // [structural cycle] in: structural cycle:
  1266  -          //     ./x.cue:30:8
  1267  +          // [incomplete] in: non-concrete value number in operand to +:
  1268  +          //     ./x.cue:30:8
  1269  +          //     ./x.cue:29:8
  1270  +          //     ./x.cue:38:17
  1271           }
  1272           k30: (_|_){
  1273  -          // [structural cycle] in: structural cycle:
  1274  -          //     ./x.cue:30:8
  1275  +          // [incomplete] in: non-concrete value number in operand to +:
  1276  +          //     ./x.cue:30:8
  1277  +          //     ./x.cue:29:8
  1278  +          //     ./x.cue:34:17
  1279           }
  1280         }
  1281         ok1: (struct){
  1282  -- diff/todo/p2 --
  1283  One test now fails. Given TODO, this may be okay.
  1284  This does break Issue #2163.