cuelang.org/go@v0.10.1/cue/testdata/eval/issue285.txtar (about)

     1  -- in.cue --
     2  #TopLevel: [name=string]: {
     3  	path:    string
     4  	content: string
     5  }
     6  
     7  #Mid: #TopLevel & {
     8  	myoutput: path: "/output"
     9  }
    10  
    11  val: #Mid & {} & {myoutput: {content: "foo"}} // Should work.
    12  -- out/eval/stats --
    13  Leaks:  0
    14  Freed:  10
    15  Reused: 6
    16  Allocs: 4
    17  Retain: 0
    18  
    19  Unifications: 10
    20  Conjuncts:    23
    21  Disjuncts:    10
    22  -- out/evalalpha --
    23  (struct){
    24    #TopLevel: (#struct){
    25    }
    26    #Mid: (#struct){
    27      myoutput: (#struct){
    28        path: (string){ "/output" }
    29        content: (string){ string }
    30      }
    31    }
    32    val: (#struct){
    33      myoutput: (#struct){
    34        content: (string){ "foo" }
    35        path: (string){ "/output" }
    36      }
    37    }
    38  }
    39  -- diff/-out/evalalpha<==>+out/eval --
    40  diff old new
    41  --- old
    42  +++ new
    43  @@ -9,8 +9,8 @@
    44     }
    45     val: (#struct){
    46       myoutput: (#struct){
    47  -      path: (string){ "/output" }
    48         content: (string){ "foo" }
    49  +      path: (string){ "/output" }
    50       }
    51     }
    52   }
    53  -- diff/todo/p3 --
    54  Reordering
    55  -- out/eval --
    56  (struct){
    57    #TopLevel: (#struct){
    58    }
    59    #Mid: (#struct){
    60      myoutput: (#struct){
    61        path: (string){ "/output" }
    62        content: (string){ string }
    63      }
    64    }
    65    val: (#struct){
    66      myoutput: (#struct){
    67        path: (string){ "/output" }
    68        content: (string){ "foo" }
    69      }
    70    }
    71  }
    72  -- out/compile --
    73  --- in.cue
    74  {
    75    #TopLevel: {
    76      [string]: {
    77        path: string
    78        content: string
    79      }
    80    }
    81    #Mid: (〈0;#TopLevel〉 & {
    82      myoutput: {
    83        path: "/output"
    84      }
    85    })
    86    val: ((〈0;#Mid〉 & {}) & {
    87      myoutput: {
    88        content: "foo"
    89      }
    90    })
    91  }