github.com/solo-io/cue@v0.4.7/cue/testdata/scalars/emptystruct.txtar (about)

     1  // Issue #783
     2  
     3  -- in.cue --
     4  elipsis: {
     5      test1: {
     6          string
     7          #foo: "bar"
     8      }
     9  
    10      #Def: {
    11          ...
    12          #foo: string
    13          _
    14      }
    15      check: test1 & #Def
    16  }
    17  
    18  bulk: {
    19      test1: {
    20          string
    21          #foo: "bar"
    22      }
    23  
    24      #Def: {
    25          [string]: int
    26          #foo: string
    27          _
    28      }
    29      check: test1 & #Def
    30  }
    31  
    32  optional: {
    33      test1: {
    34          string
    35          #foo: "bar"
    36      }
    37  
    38      #Def: {
    39          bar?: int
    40          #foo: string
    41          _
    42      }
    43      check: test1 & #Def
    44  }
    45  
    46  issue783: {
    47      test1: {
    48          string
    49          #foo: "bar"
    50      }
    51  
    52      test2: {
    53          hello: "world"
    54          #foo: "bar"
    55      }
    56  
    57  
    58      #Def1: {
    59          ...
    60          #foo: string
    61      } | {
    62          string
    63          #foo: string
    64      }
    65      check1a: test1 & #Def1
    66      check1b: test2 & #Def1
    67  
    68      #Def2: {
    69          ...
    70          #foo: string
    71          _
    72      }
    73      check2a: test1 & #Def2
    74      check2b: test2 & #Def2
    75  }
    76  -- out/eval --
    77  (struct){
    78    elipsis: (struct){
    79      test1: (string){
    80        string
    81        #foo: (string){ "bar" }
    82      }
    83      #Def: (_){
    84        _
    85        #foo: (string){ string }
    86      }
    87      check: (string){
    88        string
    89        #foo: (string){ "bar" }
    90      }
    91    }
    92    bulk: (struct){
    93      test1: (string){
    94        string
    95        #foo: (string){ "bar" }
    96      }
    97      #Def: (_){
    98        _
    99        #foo: (string){ string }
   100      }
   101      check: (string){
   102        string
   103        #foo: (string){ "bar" }
   104      }
   105    }
   106    optional: (struct){
   107      test1: (string){
   108        string
   109        #foo: (string){ "bar" }
   110      }
   111      #Def: (_){
   112        _
   113        #foo: (string){ string }
   114      }
   115      check: (string){
   116        string
   117        #foo: (string){ "bar" }
   118      }
   119    }
   120    issue783: (struct){
   121      test1: (string){
   122        string
   123        #foo: (string){ "bar" }
   124      }
   125      test2: (struct){
   126        hello: (string){ "world" }
   127        #foo: (string){ "bar" }
   128      }
   129      #Def1: ((string|struct)){ |((#struct){
   130          #foo: (string){ string }
   131        }, (string){
   132          string
   133          #foo: (string){ string }
   134        }) }
   135      check1a: (string){
   136        string
   137        #foo: (string){ "bar" }
   138      }
   139      check1b: (#struct){
   140        hello: (string){ "world" }
   141        #foo: (string){ "bar" }
   142      }
   143      #Def2: (_){
   144        _
   145        #foo: (string){ string }
   146      }
   147      check2a: (string){
   148        string
   149        #foo: (string){ "bar" }
   150      }
   151      check2b: (#struct){
   152        hello: (string){ "world" }
   153        #foo: (string){ "bar" }
   154      }
   155    }
   156  }
   157  -- out/compile --
   158  --- in.cue
   159  {
   160    elipsis: {
   161      test1: {
   162        string
   163        #foo: "bar"
   164      }
   165      #Def: {
   166        ...
   167        #foo: string
   168        _
   169      }
   170      check: (〈0;test1〉 & 〈0;#Def〉)
   171    }
   172    bulk: {
   173      test1: {
   174        string
   175        #foo: "bar"
   176      }
   177      #Def: {
   178        [string]: int
   179        #foo: string
   180        _
   181      }
   182      check: (〈0;test1〉 & 〈0;#Def〉)
   183    }
   184    optional: {
   185      test1: {
   186        string
   187        #foo: "bar"
   188      }
   189      #Def: {
   190        bar?: int
   191        #foo: string
   192        _
   193      }
   194      check: (〈0;test1〉 & 〈0;#Def〉)
   195    }
   196    issue783: {
   197      test1: {
   198        string
   199        #foo: "bar"
   200      }
   201      test2: {
   202        hello: "world"
   203        #foo: "bar"
   204      }
   205      #Def1: ({
   206        ...
   207        #foo: string
   208      }|{
   209        string
   210        #foo: string
   211      })
   212      check1a: (〈0;test1〉 & 〈0;#Def1〉)
   213      check1b: (〈0;test2〉 & 〈0;#Def1〉)
   214      #Def2: {
   215        ...
   216        #foo: string
   217        _
   218      }
   219      check2a: (〈0;test1〉 & 〈0;#Def2〉)
   220      check2b: (〈0;test2〉 & 〈0;#Def2〉)
   221    }
   222  }