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

     1  -- in.cue --
     2  #Schema: {
     3  	...
     4  }
     5  
     6  Component: {
     7  	hostname: string | *"localhost"
     8  
     9  	_#foo: {
    10  		hello: "world"
    11  	}
    12  }
    13  
    14  hello: #Schema & Component
    15  -- out/eval/stats --
    16  Leaks:  0
    17  Freed:  14
    18  Reused: 9
    19  Allocs: 5
    20  Retain: 0
    21  
    22  Unifications: 10
    23  Conjuncts:    18
    24  Disjuncts:    14
    25  -- out/eval --
    26  (struct){
    27    #Schema: (#struct){
    28    }
    29    Component: (struct){
    30      hostname: (string){ |(*(string){ "localhost" }, (string){ string }) }
    31      _#foo: (#struct){
    32        hello: (string){ "world" }
    33      }
    34    }
    35    hello: (#struct){
    36      hostname: (string){ |(*(string){ "localhost" }, (string){ string }) }
    37      _#foo: (#struct){
    38        hello: (string){ "world" }
    39      }
    40    }
    41  }
    42  -- out/compile --
    43  --- in.cue
    44  {
    45    #Schema: {
    46      ...
    47    }
    48    Component: {
    49      hostname: (string|*"localhost")
    50      _#foo: {
    51        hello: "world"
    52      }
    53    }
    54    hello: (〈0;#Schema〉 & 〈0;Component〉)
    55  }