cuelang.org/go@v0.13.0/cue/testdata/eval/sharing.txtar (about)

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