...

Text file src/cuelang.org/go/cue/testdata/eval/conflicts.txtar

Documentation: cuelang.org/go/cue/testdata/eval

     1-- in.cue --
     2i: int
     3s: string
     4
     5t0: {
     6	v: i & s
     7}
     8
     9t1: {
    10	#d1: {
    11		a: b: 3
    12	}
    13
    14	#d2: {
    15		a: b: 4
    16	}
    17
    18	x: #d1 & #d2
    19}
    20-- out/eval/stats --
    21Leaks:  0
    22Freed:  15
    23Reused: 10
    24Allocs: 5
    25Retain: 0
    26
    27Unifications: 15
    28Conjuncts:    23
    29Disjuncts:    15
    30-- out/evalalpha --
    31Errors:
    32t0.v: conflicting values int and string (mismatched types int and string):
    33    ./in.cue:1:4
    34    ./in.cue:2:4
    35t1.x.a.b: conflicting values 4 and 3:
    36    ./in.cue:10:9
    37    ./in.cue:14:9
    38
    39Result:
    40(_|_){
    41  // [eval]
    42  i: (int){ int }
    43  s: (string){ string }
    44  t0: (_|_){
    45    // [eval]
    46    v: (_|_){
    47      // [eval] t0.v: conflicting values int and string (mismatched types int and string):
    48      //     ./in.cue:1:4
    49      //     ./in.cue:2:4
    50    }
    51  }
    52  t1: (_|_){
    53    // [eval]
    54    #d1: (#struct){
    55      a: (#struct){
    56        b: (int){ 3 }
    57      }
    58    }
    59    #d2: (#struct){
    60      a: (#struct){
    61        b: (int){ 4 }
    62      }
    63    }
    64    x: (_|_){
    65      // [eval]
    66      a: (_|_){
    67        // [eval]
    68        b: (_|_){
    69          // [eval] t1.x.a.b: conflicting values 4 and 3:
    70          //     ./in.cue:10:9
    71          //     ./in.cue:14:9
    72        }
    73      }
    74    }
    75  }
    76}
    77-- diff/-out/evalalpha<==>+out/eval --
    78diff old new
    79--- old
    80+++ new
    81@@ -2,12 +2,9 @@
    82 t0.v: conflicting values int and string (mismatched types int and string):
    83     ./in.cue:1:4
    84     ./in.cue:2:4
    85-    ./in.cue:5:9
    86 t1.x.a.b: conflicting values 4 and 3:
    87     ./in.cue:10:9
    88     ./in.cue:14:9
    89-    ./in.cue:17:5
    90-    ./in.cue:17:11
    91 
    92 Result:
    93 (_|_){
    94@@ -20,7 +17,6 @@
    95       // [eval] t0.v: conflicting values int and string (mismatched types int and string):
    96       //     ./in.cue:1:4
    97       //     ./in.cue:2:4
    98-      //     ./in.cue:5:9
    99     }
   100   }
   101   t1: (_|_){
   102@@ -43,8 +39,6 @@
   103           // [eval] t1.x.a.b: conflicting values 4 and 3:
   104           //     ./in.cue:10:9
   105           //     ./in.cue:14:9
   106-          //     ./in.cue:17:5
   107-          //     ./in.cue:17:11
   108         }
   109       }
   110     }
   111-- diff/todo/p2 --
   112Positions.
   113-- out/eval --
   114Errors:
   115t0.v: conflicting values int and string (mismatched types int and string):
   116    ./in.cue:1:4
   117    ./in.cue:2:4
   118    ./in.cue:5:9
   119t1.x.a.b: conflicting values 4 and 3:
   120    ./in.cue:10:9
   121    ./in.cue:14:9
   122    ./in.cue:17:5
   123    ./in.cue:17:11
   124
   125Result:
   126(_|_){
   127  // [eval]
   128  i: (int){ int }
   129  s: (string){ string }
   130  t0: (_|_){
   131    // [eval]
   132    v: (_|_){
   133      // [eval] t0.v: conflicting values int and string (mismatched types int and string):
   134      //     ./in.cue:1:4
   135      //     ./in.cue:2:4
   136      //     ./in.cue:5:9
   137    }
   138  }
   139  t1: (_|_){
   140    // [eval]
   141    #d1: (#struct){
   142      a: (#struct){
   143        b: (int){ 3 }
   144      }
   145    }
   146    #d2: (#struct){
   147      a: (#struct){
   148        b: (int){ 4 }
   149      }
   150    }
   151    x: (_|_){
   152      // [eval]
   153      a: (_|_){
   154        // [eval]
   155        b: (_|_){
   156          // [eval] t1.x.a.b: conflicting values 4 and 3:
   157          //     ./in.cue:10:9
   158          //     ./in.cue:14:9
   159          //     ./in.cue:17:5
   160          //     ./in.cue:17:11
   161        }
   162      }
   163    }
   164  }
   165}
   166-- out/compile --
   167--- in.cue
   168{
   169  i: int
   170  s: string
   171  t0: {
   172    v: (〈1;i〉 & 〈1;s〉)
   173  }
   174  t1: {
   175    #d1: {
   176      a: {
   177        b: 3
   178      }
   179    }
   180    #d2: {
   181      a: {
   182        b: 4
   183      }
   184    }
   185    x: (〈0;#d1〉 & 〈0;#d2〉)
   186  }
   187}

View as plain text