cuelang.org/go@v0.10.1/cue/testdata/definitions/issue367.txtar (about)

     1  TODO: l4 should be allowed
     2  
     3  -- in.cue --
     4  #def1: l1: ["l2"]: {l3: int, l4: 26}
     5  #special1: #def1 & {l1: l2: l3:     <100}
     6  instance:  #special1 & {l1: l2: l3: 34}
     7  -- out/eval/stats --
     8  Leaks:  0
     9  Freed:  17
    10  Reused: 12
    11  Allocs: 5
    12  Retain: 0
    13  
    14  Unifications: 17
    15  Conjuncts:    36
    16  Disjuncts:    17
    17  -- out/eval --
    18  (struct){
    19    #def1: (#struct){
    20      l1: (#struct){
    21      }
    22    }
    23    #special1: (#struct){
    24      l1: (#struct){
    25        l2: (#struct){
    26          l3: (int){ &(<100, int) }
    27          l4: (int){ 26 }
    28        }
    29      }
    30    }
    31    instance: (#struct){
    32      l1: (#struct){
    33        l2: (#struct){
    34          l3: (int){ 34 }
    35          l4: (int){ 26 }
    36        }
    37      }
    38    }
    39  }
    40  -- out/compile --
    41  --- in.cue
    42  {
    43    #def1: {
    44      l1: {
    45        ["l2"]: {
    46          l3: int
    47          l4: 26
    48        }
    49      }
    50    }
    51    #special1: (〈0;#def1〉 & {
    52      l1: {
    53        l2: {
    54          l3: <100
    55        }
    56      }
    57    })
    58    instance: (〈0;#special1〉 & {
    59      l1: {
    60        l2: {
    61          l3: 34
    62        }
    63      }
    64    })
    65  }