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

     1  -- in.cue --
     2  package x
     3  
     4  #Prestep: {
     5  	Args: *null | _
     6  }
     7  
     8  #PrestepNewUser: #Prestep & {
     9  	Args: #NewUser
    10  }
    11  
    12  #NewUser: {
    13  	Repos: [...#Repo]
    14  }
    15  
    16  #Repo: {
    17  	Var:     string
    18  	Pattern: *"*" | string
    19  }
    20  
    21  x: [...#Repo]
    22  x: [{
    23  	Var: "REPO1"
    24  }]
    25  
    26  y: #Repo & {
    27  	Var: "REPO1"
    28  }
    29  
    30  z: #PrestepNewUser & {
    31  	Args: {
    32  		Repos: [ {
    33  			Var: "REPO1"
    34  		}]
    35  	}
    36  }
    37  -- out/eval --
    38  (struct){
    39    #Prestep: (#struct){
    40      Args: (_){ |(*(null){ null }, (_){ _ }) }
    41    }
    42    #PrestepNewUser: (#struct){
    43      Args: (#struct){
    44        Repos: (list){
    45        }
    46      }
    47    }
    48    #NewUser: (#struct){
    49      Repos: (list){
    50      }
    51    }
    52    #Repo: (#struct){
    53      Var: (string){ string }
    54      Pattern: (string){ |(*(string){ "*" }, (string){ string }) }
    55    }
    56    x: (#list){
    57      0: (#struct){
    58        Var: (string){ "REPO1" }
    59        Pattern: (string){ |(*(string){ "*" }, (string){ string }) }
    60      }
    61    }
    62    y: (#struct){
    63      Var: (string){ "REPO1" }
    64      Pattern: (string){ |(*(string){ "*" }, (string){ string }) }
    65    }
    66    z: (#struct){
    67      Args: (#struct){
    68        Repos: (#list){
    69          0: (#struct){
    70            Var: (string){ "REPO1" }
    71            Pattern: (string){ |(*(string){ "*" }, (string){ string }) }
    72          }
    73        }
    74      }
    75    }
    76  }
    77  -- out/compile --
    78  --- in.cue
    79  {
    80    #Prestep: {
    81      Args: (*null|_)
    82    }
    83    #PrestepNewUser: (〈0;#Prestep〉 & {
    84      Args: 〈1;#NewUser〉
    85    })
    86    #NewUser: {
    87      Repos: [
    88        ...〈1;#Repo〉,
    89      ]
    90    }
    91    #Repo: {
    92      Var: string
    93      Pattern: (*"*"|string)
    94    }
    95    x: [
    96      ...〈0;#Repo〉,
    97    ]
    98    x: [
    99      {
   100        Var: "REPO1"
   101      },
   102    ]
   103    y: (〈0;#Repo〉 & {
   104      Var: "REPO1"
   105    })
   106    z: (〈0;#PrestepNewUser〉 & {
   107      Args: {
   108        Repos: [
   109          {
   110            Var: "REPO1"
   111          },
   112        ]
   113      }
   114    })
   115  }