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

     1  -- in.cue --
     2  object: #Leaf & {}
     3  
     4  #Base: {
     5  	extra?: {...}
     6  }
     7  
     8  #Mid: {
     9  	#Base
    10  }
    11  
    12  #Leaf: {
    13  	#Mid
    14  	extra?:  {...}
    15  	more?: int
    16  	if extra.foo != _|_ {
    17  		if more != _|_ {
    18  			foo: "bar"
    19  		}
    20  	}
    21  }
    22  -- out/eval --
    23  (struct){
    24    object: (#struct){
    25      extra?: (#struct){
    26      }
    27      more?: (int){ int }
    28    }
    29    #Base: (#struct){
    30      extra?: (#struct){
    31      }
    32    }
    33    #Mid: (#struct){
    34      extra?: (#struct){
    35      }
    36    }
    37    #Leaf: (#struct){
    38      extra?: (#struct){
    39      }
    40      more?: (int){ int }
    41    }
    42  }
    43  -- out/eval/stats --
    44  Leaks:  0
    45  Freed:  11
    46  Reused: 5
    47  Allocs: 6
    48  Retain: 7
    49  
    50  Unifications: 11
    51  Conjuncts:    25
    52  Disjuncts:    18
    53  -- out/compile --
    54  --- in.cue
    55  {
    56    object: (〈0;#Leaf〉 & {})
    57    #Base: {
    58      extra?: {
    59        ...
    60      }
    61    }
    62    #Mid: {
    63      〈1;#Base〉
    64    }
    65    #Leaf: {
    66      〈1;#Mid〉
    67      extra?: {
    68        ...
    69      }
    70      more?: int
    71      if (〈0;extra〉.foo != _|_(explicit error (_|_ literal) in source)) {
    72        if (〈1;more〉 != _|_(explicit error (_|_ literal) in source)) {
    73          foo: "bar"
    74        }
    75      }
    76    }
    77  }