github.com/solo-io/cue@v0.4.7/cue/testdata/basicrewrite/015_types.txtar (about)

     1  # DO NOT EDIT; generated by go run testdata/gen.go
     2  #
     3  #name: types
     4  #evalPartial
     5  -- in.cue --
     6  i:  int
     7  j:  int & 3
     8  s:  string
     9  t:  "s" & string
    10  e:  int & string
    11  e2: 1 & string
    12  b:  !int
    13  p:  +true
    14  m:  -false
    15  -- out/def --
    16  i:  int
    17  j:  3
    18  s:  string
    19  t:  "s"
    20  e:  _|_ // conflicting values int and string (mismatched types int and string)
    21  e2: _|_ // conflicting values 1 and string (mismatched types int and string)
    22  b:  _|_ // invalid operation !int (! int)
    23  p:  _|_ // invalid operation +true (+ bool)
    24  m:  _|_ // invalid operation -false (- bool)
    25  -- out/legacy-debug --
    26  <0>{i: int, j: 3, s: string, t: "s", e: _|_((int & string):conflicting values int and string (mismatched types int and string)), e2: _|_((1 & string):conflicting values 1 and string (mismatched types int and string)), b: _|_(!int:invalid operation !int (! int)), p: _|_(+true:invalid operation +true (+ bool)), m: _|_(-false:invalid operation -false (- bool))}
    27  -- out/compile --
    28  --- in.cue
    29  {
    30    i: int
    31    j: (int & 3)
    32    s: string
    33    t: ("s" & string)
    34    e: (int & string)
    35    e2: (1 & string)
    36    b: !int
    37    p: +true
    38    m: -false
    39  }
    40  -- out/eval --
    41  Errors:
    42  b: invalid operand int ('!' requires concrete value):
    43      ./in.cue:7:6
    44  e: conflicting values int and string (mismatched types int and string):
    45      ./in.cue:5:5
    46      ./in.cue:5:11
    47  e2: conflicting values 1 and string (mismatched types int and string):
    48      ./in.cue:6:5
    49      ./in.cue:6:9
    50  p: invalid operation +true (+ bool):
    51      ./in.cue:8:5
    52  m: invalid operation -false (- bool):
    53      ./in.cue:9:5
    54  
    55  Result:
    56  (_|_){
    57    // [eval]
    58    i: (int){ int }
    59    j: (int){ 3 }
    60    s: (string){ string }
    61    t: (string){ "s" }
    62    e: (_|_){
    63      // [eval] e: conflicting values int and string (mismatched types int and string):
    64      //     ./in.cue:5:5
    65      //     ./in.cue:5:11
    66    }
    67    e2: (_|_){
    68      // [eval] e2: conflicting values 1 and string (mismatched types int and string):
    69      //     ./in.cue:6:5
    70      //     ./in.cue:6:9
    71    }
    72    b: (_|_){
    73      // [eval] b: invalid operand int ('!' requires concrete value):
    74      //     ./in.cue:7:6
    75    }
    76    p: (_|_){
    77      // [eval] p: invalid operation +true (+ bool):
    78      //     ./in.cue:8:5
    79    }
    80    m: (_|_){
    81      // [eval] m: invalid operation -false (- bool):
    82      //     ./in.cue:9:5
    83    }
    84  }