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

     1  -- in.cue --
     2  foo: string
     3  bar: close({})
     4  
     5  if bar.missing == "x" {
     6  	let _bar = bar
     7  	foo: _bar
     8  }
     9  -- out/compile --
    10  --- in.cue
    11  {
    12    foo: string
    13    bar: close({})
    14    if (〈0;bar〉.missing == "x") {
    15      let _bar#1 = 〈1;bar〉
    16      foo: 〈0;let _bar#1〉
    17    }
    18  }
    19  -- out/eval/stats --
    20  Leaks:  1
    21  Freed:  4
    22  Reused: 1
    23  Allocs: 4
    24  Retain: 2
    25  
    26  Unifications: 5
    27  Conjuncts:    5
    28  Disjuncts:    6
    29  -- out/eval --
    30  Errors:
    31  undefined field: missing:
    32      ./in.cue:4:8
    33  
    34  Result:
    35  (_|_){
    36    // [eval] undefined field: missing:
    37    //     ./in.cue:4:8
    38    foo: (string){ string }
    39    bar: (#struct){
    40    }
    41    let _bar#1 = (_){ _ }
    42  }
    43  -- out/evalalpha --
    44  Errors:
    45  undefined field: missing:
    46      ./in.cue:4:8
    47  
    48  Result:
    49  (_|_){
    50    // [eval] undefined field: missing:
    51    //     ./in.cue:4:8
    52    foo: (_|_){
    53      // [incomplete] undefined field: missing:
    54      //     ./in.cue:4:8
    55    }
    56    bar: (#struct){
    57    }
    58    let _bar#1multi = 〈1;bar〉
    59  }
    60  -- diff/-out/evalalpha<==>+out/eval --
    61  diff old new
    62  --- old
    63  +++ new
    64  @@ -6,8 +6,11 @@
    65   (_|_){
    66     // [eval] undefined field: missing:
    67     //     ./in.cue:4:8
    68  -  foo: (string){ string }
    69  +  foo: (_|_){
    70  +    // [incomplete] undefined field: missing:
    71  +    //     ./in.cue:4:8
    72  +  }
    73     bar: (#struct){
    74     }
    75  -  let _bar#1 = (_){ _ }
    76  +  let _bar#1multi = 〈1;bar〉
    77   }
    78  -- diff/todo/p2 --
    79  Let seems to have misplaced error, even though it does not affect outcome.