cuelang.org/go@v0.10.1/cue/testdata/fulleval/000_detect_conflicting_value.txtar (about)

     1  #name: detect conflicting value
     2  #evalFull
     3  -- in.cue --
     4  a: 8000.9
     5  a: 7080 | int
     6  -- out/def --
     7  a: _|_ // conflicting values 8000.9 and int (mismatched types float and int)
     8  -- out/legacy-debug --
     9  <0>{a: _|_((8000.9 & (int | int)):conflicting values 8000.9 and int (mismatched types float and int))}
    10  -- out/compile --
    11  --- in.cue
    12  {
    13    a: 8000.9
    14    a: (7080|int)
    15  }
    16  -- out/eval/stats --
    17  Leaks:  0
    18  Freed:  4
    19  Reused: 1
    20  Allocs: 3
    21  Retain: 0
    22  
    23  Unifications: 2
    24  Conjuncts:    5
    25  Disjuncts:    4
    26  -- out/evalalpha --
    27  Errors:
    28  a: conflicting values 8000.9 and 7080 (mismatched types float and int):
    29      ./in.cue:1:4
    30      ./in.cue:2:4
    31  a: conflicting values 8000.9 and int (mismatched types float and int):
    32      ./in.cue:1:4
    33      ./in.cue:2:11
    34  
    35  Result:
    36  (_|_){
    37    // [eval]
    38    a: (_|_){
    39      // [eval] a: conflicting values 8000.9 and 7080 (mismatched types float and int):
    40      //     ./in.cue:1:4
    41      //     ./in.cue:2:4
    42      // a: conflicting values 8000.9 and int (mismatched types float and int):
    43      //     ./in.cue:1:4
    44      //     ./in.cue:2:11
    45    }
    46  }
    47  -- diff/-out/evalalpha<==>+out/eval --
    48  diff old new
    49  --- old
    50  +++ new
    51  @@ -1,5 +1,4 @@
    52   Errors:
    53  -a: 2 errors in empty disjunction:
    54   a: conflicting values 8000.9 and 7080 (mismatched types float and int):
    55       ./in.cue:1:4
    56       ./in.cue:2:4
    57  @@ -11,8 +10,7 @@
    58   (_|_){
    59     // [eval]
    60     a: (_|_){
    61  -    // [eval] a: 2 errors in empty disjunction:
    62  -    // a: conflicting values 8000.9 and 7080 (mismatched types float and int):
    63  +    // [eval] a: conflicting values 8000.9 and 7080 (mismatched types float and int):
    64       //     ./in.cue:1:4
    65       //     ./in.cue:2:4
    66       // a: conflicting values 8000.9 and int (mismatched types float and int):
    67  -- diff/todo/p2 --
    68  Missing "X errors in empty disjunctions" message.
    69  -- out/eval --
    70  Errors:
    71  a: 2 errors in empty disjunction:
    72  a: conflicting values 8000.9 and 7080 (mismatched types float and int):
    73      ./in.cue:1:4
    74      ./in.cue:2:4
    75  a: conflicting values 8000.9 and int (mismatched types float and int):
    76      ./in.cue:1:4
    77      ./in.cue:2:11
    78  
    79  Result:
    80  (_|_){
    81    // [eval]
    82    a: (_|_){
    83      // [eval] a: 2 errors in empty disjunction:
    84      // a: conflicting values 8000.9 and 7080 (mismatched types float and int):
    85      //     ./in.cue:1:4
    86      //     ./in.cue:2:4
    87      // a: conflicting values 8000.9 and int (mismatched types float and int):
    88      //     ./in.cue:1:4
    89      //     ./in.cue:2:11
    90    }
    91  }