...

Text file src/cuelang.org/go/cue/testdata/eval/issue2550.txtar

Documentation: cuelang.org/go/cue/testdata/eval

     1-- in.cue --
     2foo: string
     3bar: close({})
     4
     5if 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 --
    20Leaks:  1
    21Freed:  4
    22Reused: 1
    23Allocs: 4
    24Retain: 5
    25
    26Unifications: 5
    27Conjuncts:    5
    28Disjuncts:    9
    29-- out/evalalpha --
    30(_|_){
    31  // [incomplete] undefined field: missing:
    32  //     ./in.cue:4:8
    33  foo: (_|_){
    34    // [incomplete] undefined field: missing:
    35    //     ./in.cue:4:8
    36  }
    37  bar: (#struct){
    38  }
    39  let _bar#1 = (_|_){
    40    // [incomplete] undefined field: missing:
    41    //     ./in.cue:4:8
    42  }
    43}
    44-- diff/-out/evalalpha<==>+out/eval --
    45diff old new
    46--- old
    47+++ new
    48@@ -7,5 +7,8 @@
    49   }
    50   bar: (#struct){
    51   }
    52-  let _bar#1 = (_){ _ }
    53+  let _bar#1 = (_|_){
    54+    // [incomplete] undefined field: missing:
    55+    //     ./in.cue:4:8
    56+  }
    57 }
    58-- diff/todo/p2 --
    59Let seems to have misplaced error, even though it does not affect outcome.
    60-- out/eval --
    61(_|_){
    62  // [incomplete] undefined field: missing:
    63  //     ./in.cue:4:8
    64  foo: (_|_){
    65    // [incomplete] undefined field: missing:
    66    //     ./in.cue:4:8
    67  }
    68  bar: (#struct){
    69  }
    70  let _bar#1 = (_){ _ }
    71}

View as plain text