github.com/joomcode/cue@v0.4.4-0.20221111115225-539fe3512047/cue/testdata/fulleval/042_cross-dependent_comprehension.txtar (about)

     1  # DO NOT EDIT; generated by go run testdata/gen.go
     2  #
     3  #name: cross-dependent comprehension
     4  #evalFull
     5  -- in.cue --
     6  #a: {
     7  	if b {
     8  		c: 4
     9  	}
    10  	b: bool
    11  }
    12  x: (#a & {b: true}) & {c: 4}
    13  y: x
    14  -- out/def --
    15  x: _|_ // field "c" not allowed in closed struct
    16  y: _|_ // field "c" not allowed in closed struct
    17  #a: {
    18  	b: bool
    19  	if b {
    20  		c: 4
    21  	}
    22  }
    23  -- out/legacy-debug --
    24  <0>{x: _|_(4:field "c" not allowed in closed struct), y: _|_(4:field "c" not allowed in closed struct), #a: <1>C{b: bool if <2>.b yield <3>C{c: 4}}}
    25  -- out/compile --
    26  --- in.cue
    27  {
    28    #a: {
    29      if 〈0;b〉 {
    30        c: 4
    31      }
    32      b: bool
    33    }
    34    x: ((〈0;#a〉 & {
    35      b: true
    36    }) & {
    37      c: 4
    38    })
    39    y: 〈0;x〉
    40  }
    41  -- out/eval --
    42  (struct){
    43    #a: (_|_){
    44      // [incomplete] #a: incomplete bool: bool:
    45      //     ./in.cue:5:5
    46      b: (bool){ bool }
    47    }
    48    x: (#struct){
    49      b: (bool){ true }
    50      c: (int){ 4 }
    51    }
    52    y: (#struct){
    53      b: (bool){ true }
    54      c: (int){ 4 }
    55    }
    56  }