github.com/solo-io/cue@v0.4.7/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 --
    16  (struct){
    17    #Schema: (#struct){
    18    }
    19    Component: (struct){
    20      hostname: (string){ |(*(string){ "localhost" }, (string){ string }) }
    21      _#foo: (#struct){
    22        hello: (string){ "world" }
    23      }
    24    }
    25    hello: (#struct){
    26      hostname: (string){ |(*(string){ "localhost" }, (string){ string }) }
    27      _#foo: (#struct){
    28        hello: (string){ "world" }
    29      }
    30    }
    31  }
    32  -- out/compile --
    33  --- in.cue
    34  {
    35    #Schema: {
    36      ...
    37    }
    38    Component: {
    39      hostname: (string|*"localhost")
    40      _#foo: {
    41        hello: "world"
    42      }
    43    }
    44    hello: (〈0;#Schema〉 & 〈0;Component〉)
    45  }