github.com/joomcode/cue@v0.4.4-0.20221111115225-539fe3512047/cue/testdata/benchmarks/dedupelem.txtar (about)

     1  -- in.cue --
     2  package lpcorpus
     3  
     4  #Value: {type: "int"} | {type: "float"} | {type: "string"}
     5  
     6  foo: [{type: "float"}] & [...#Value]
     7  foo: [{type: "float"}] & [...#Value]
     8  foo: [{type: "float"}] & [...#Value]
     9  foo: [{type: "float"}] & [...#Value]
    10  foo: [{type: "float"}] & [...#Value]
    11  foo: [{type: "string"}] & [...#Value]
    12  foo: [{type: "string"}] & [...#Value]
    13  foo: [{type: "string"}] & [...#Value]
    14  foo: [{type: "float"}] & [...#Value]
    15  foo: [{type: "float"}] & [...#Value]
    16  -- out/eval --
    17  Errors:
    18  foo.0: 2 errors in empty disjunction:
    19  foo.0.type: conflicting values "int" and "float":
    20      ./in.cue:3:16
    21      ./in.cue:5:14
    22      ./in.cue:5:27
    23      ./in.cue:5:30
    24  foo.0.type: conflicting values "string" and "float":
    25      ./in.cue:5:14
    26      ./in.cue:10:14
    27  
    28  Result:
    29  (_|_){
    30    // [eval]
    31    #Value: (#struct){ |((#struct){
    32        type: (string){ "int" }
    33      }, (#struct){
    34        type: (string){ "float" }
    35      }, (#struct){
    36        type: (string){ "string" }
    37      }) }
    38    foo: (_|_){
    39      // [eval]
    40      0: (_|_){
    41        // [eval] foo.0: 2 errors in empty disjunction:
    42        // foo.0.type: conflicting values "int" and "float":
    43        //     ./in.cue:3:16
    44        //     ./in.cue:5:14
    45        //     ./in.cue:5:27
    46        //     ./in.cue:5:30
    47        // foo.0.type: conflicting values "string" and "float":
    48        //     ./in.cue:5:14
    49        //     ./in.cue:10:14
    50        type: (_|_){
    51          // [eval] foo.0.type: conflicting values "string" and "float":
    52          //     ./in.cue:5:14
    53          //     ./in.cue:10:14
    54        }
    55      }
    56    }
    57  }
    58  -- out/compile --
    59  --- in.cue
    60  {
    61    #Value: ({
    62      type: "int"
    63    }|{
    64      type: "float"
    65    }|{
    66      type: "string"
    67    })
    68    foo: ([
    69      {
    70        type: "float"
    71      },
    72    ] & [
    73      ...〈1;#Value〉,
    74    ])
    75    foo: ([
    76      {
    77        type: "float"
    78      },
    79    ] & [
    80      ...〈1;#Value〉,
    81    ])
    82    foo: ([
    83      {
    84        type: "float"
    85      },
    86    ] & [
    87      ...〈1;#Value〉,
    88    ])
    89    foo: ([
    90      {
    91        type: "float"
    92      },
    93    ] & [
    94      ...〈1;#Value〉,
    95    ])
    96    foo: ([
    97      {
    98        type: "float"
    99      },
   100    ] & [
   101      ...〈1;#Value〉,
   102    ])
   103    foo: ([
   104      {
   105        type: "string"
   106      },
   107    ] & [
   108      ...〈1;#Value〉,
   109    ])
   110    foo: ([
   111      {
   112        type: "string"
   113      },
   114    ] & [
   115      ...〈1;#Value〉,
   116    ])
   117    foo: ([
   118      {
   119        type: "string"
   120      },
   121    ] & [
   122      ...〈1;#Value〉,
   123    ])
   124    foo: ([
   125      {
   126        type: "float"
   127      },
   128    ] & [
   129      ...〈1;#Value〉,
   130    ])
   131    foo: ([
   132      {
   133        type: "float"
   134      },
   135    ] & [
   136      ...〈1;#Value〉,
   137    ])
   138  }