1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282
|
-- cue.mod/module.cue --
module: "cuelang.org/error"
language: version: "v0.14.0"
-- in.cue --
selection: {
dropError: 1 | error("drop me")
useUserError: 1&2 | error("use me")
twoUserErrors: 1&2 | error("error one") | error("error two")
x: int
dropIncomplete: x + 1 | error("user msg: x + 1 failed")
}
interpolation: {
a: {b: int}
world: "world"
substituteAll: a.notExist | error("hello \(world)")
substituteFail: a.b + 1 | a.notExist | error("reference failed: \(a.b) | \(a.notExist)")
}
indirect: {
x: error
y: x("msg")
}
-- out/eval/stats --
Leaks: 0
Freed: 30
Reused: 25
Allocs: 5
Retain: 0
Unifications: 16
Conjuncts: 38
Disjuncts: 30
-- out/evalalpha --
Errors:
selection.twoUserErrors: 2 errors in empty disjunction:
selection.useUserError: use me:
./in.cue:4:22
selection.twoUserErrors: error one:
./in.cue:6:23
selection.twoUserErrors: error two:
./in.cue:6:44
indirect.y: msg:
./in.cue:22:5
Result:
(_|_){
// [user]
selection: (_|_){
// [user]
dropError: (int){ 1 }
useUserError: (_|_){
// [user] selection.useUserError: use me:
// ./in.cue:4:22
}
twoUserErrors: (_|_){
// [user] selection.twoUserErrors: 2 errors in empty disjunction:
// selection.twoUserErrors: error one:
// ./in.cue:6:23
// selection.twoUserErrors: error two:
// ./in.cue:6:44
}
x: (int){ int }
dropIncomplete: (_|_){
// [incomplete] selection.dropIncomplete: user msg: x + 1 failed:
// ./in.cue:9:26
}
}
interpolation: (struct){
a: (struct){
b: (int){ int }
}
world: (string){ "world" }
substituteAll: (_|_){
// [incomplete] interpolation.substituteAll: hello world:
// ./in.cue:16:30
}
substituteFail: (_|_){
// [incomplete] interpolation.substituteFail: reference failed: int | a.notExist:
// ./in.cue:18:41
// ./in.cue:13:9
// ./in.cue:18:77
}
}
indirect: (_|_){
// [user]
x: (string){ error() }
y: (_|_){
// [user] indirect.y: msg:
// ./in.cue:22:5
}
}
}
-- diff/-out/evalalpha<==>+out/eval --
diff old new
--- old
+++ new
@@ -1,12 +1,5 @@
Errors:
-selection.twoUserErrors: 3 errors in empty disjunction:
-selection.twoUserErrors: conflicting values 2 and 1:
- ./in.cue:6:17
- ./in.cue:6:19
-selection.useUserError: 2 errors in empty disjunction:
-selection.useUserError: conflicting values 2 and 1:
- ./in.cue:4:16
- ./in.cue:4:18
+selection.twoUserErrors: 2 errors in empty disjunction:
selection.useUserError: use me:
./in.cue:4:22
selection.twoUserErrors: error one:
@@ -23,18 +16,11 @@
// [user]
dropError: (int){ 1 }
useUserError: (_|_){
- // [user] selection.useUserError: 2 errors in empty disjunction:
- // selection.useUserError: conflicting values 2 and 1:
- // ./in.cue:4:16
- // ./in.cue:4:18
- // selection.useUserError: use me:
+ // [user] selection.useUserError: use me:
// ./in.cue:4:22
}
twoUserErrors: (_|_){
- // [user] selection.twoUserErrors: 3 errors in empty disjunction:
- // selection.twoUserErrors: conflicting values 2 and 1:
- // ./in.cue:6:17
- // ./in.cue:6:19
+ // [user] selection.twoUserErrors: 2 errors in empty disjunction:
// selection.twoUserErrors: error one:
// ./in.cue:6:23
// selection.twoUserErrors: error two:
@@ -42,11 +28,7 @@
}
x: (int){ int }
dropIncomplete: (_|_){
- // [incomplete] selection.dropIncomplete: 2 errors in empty disjunction:
- // selection.dropIncomplete: non-concrete value int in operand to +:
- // ./in.cue:9:18
- // ./in.cue:8:5
- // selection.dropIncomplete: user msg: x + 1 failed:
+ // [incomplete] selection.dropIncomplete: user msg: x + 1 failed:
// ./in.cue:9:26
}
}
@@ -56,20 +38,11 @@
}
world: (string){ "world" }
substituteAll: (_|_){
- // [incomplete] interpolation.substituteAll: 2 errors in empty disjunction:
- // interpolation.substituteAll: undefined field: notExist:
- // ./in.cue:16:19
- // interpolation.substituteAll: hello world:
+ // [incomplete] interpolation.substituteAll: hello world:
// ./in.cue:16:30
}
substituteFail: (_|_){
- // [incomplete] interpolation.substituteFail: 3 errors in empty disjunction:
- // interpolation.substituteFail: non-concrete value int in operand to +:
- // ./in.cue:18:18
- // ./in.cue:13:9
- // interpolation.substituteFail: undefined field: notExist:
- // ./in.cue:18:30
- // interpolation.substituteFail: reference failed: int | a.notExist:
+ // [incomplete] interpolation.substituteFail: reference failed: int | a.notExist:
// ./in.cue:18:41
// ./in.cue:13:9
// ./in.cue:18:77
-- out/eval --
Errors:
selection.twoUserErrors: 3 errors in empty disjunction:
selection.twoUserErrors: conflicting values 2 and 1:
./in.cue:6:17
./in.cue:6:19
selection.useUserError: 2 errors in empty disjunction:
selection.useUserError: conflicting values 2 and 1:
./in.cue:4:16
./in.cue:4:18
selection.useUserError: use me:
./in.cue:4:22
selection.twoUserErrors: error one:
./in.cue:6:23
selection.twoUserErrors: error two:
./in.cue:6:44
indirect.y: msg:
./in.cue:22:5
Result:
(_|_){
// [user]
selection: (_|_){
// [user]
dropError: (int){ 1 }
useUserError: (_|_){
// [user] selection.useUserError: 2 errors in empty disjunction:
// selection.useUserError: conflicting values 2 and 1:
// ./in.cue:4:16
// ./in.cue:4:18
// selection.useUserError: use me:
// ./in.cue:4:22
}
twoUserErrors: (_|_){
// [user] selection.twoUserErrors: 3 errors in empty disjunction:
// selection.twoUserErrors: conflicting values 2 and 1:
// ./in.cue:6:17
// ./in.cue:6:19
// selection.twoUserErrors: error one:
// ./in.cue:6:23
// selection.twoUserErrors: error two:
// ./in.cue:6:44
}
x: (int){ int }
dropIncomplete: (_|_){
// [incomplete] selection.dropIncomplete: 2 errors in empty disjunction:
// selection.dropIncomplete: non-concrete value int in operand to +:
// ./in.cue:9:18
// ./in.cue:8:5
// selection.dropIncomplete: user msg: x + 1 failed:
// ./in.cue:9:26
}
}
interpolation: (struct){
a: (struct){
b: (int){ int }
}
world: (string){ "world" }
substituteAll: (_|_){
// [incomplete] interpolation.substituteAll: 2 errors in empty disjunction:
// interpolation.substituteAll: undefined field: notExist:
// ./in.cue:16:19
// interpolation.substituteAll: hello world:
// ./in.cue:16:30
}
substituteFail: (_|_){
// [incomplete] interpolation.substituteFail: 3 errors in empty disjunction:
// interpolation.substituteFail: non-concrete value int in operand to +:
// ./in.cue:18:18
// ./in.cue:13:9
// interpolation.substituteFail: undefined field: notExist:
// ./in.cue:18:30
// interpolation.substituteFail: reference failed: int | a.notExist:
// ./in.cue:18:41
// ./in.cue:13:9
// ./in.cue:18:77
}
}
indirect: (_|_){
// [user]
x: (string){ error() }
y: (_|_){
// [user] indirect.y: msg:
// ./in.cue:22:5
}
}
}
-- out/compile --
--- in.cue
{
selection: {
dropError: (1|error("drop me"))
useUserError: ((1 & 2)|error("use me"))
twoUserErrors: ((1 & 2)|error("error one")|error("error two"))
x: int
dropIncomplete: ((〈0;x〉 + 1)|error("user msg: x + 1 failed"))
}
interpolation: {
a: {
b: int
}
world: "world"
substituteAll: (〈0;a〉.notExist|error("hello \(〈0;world〉)"))
substituteFail: ((〈0;a〉.b + 1)|〈0;a〉.notExist|error("reference failed: \(〈0;a〉.b) | \(〈0;a〉.notExist)"))
}
indirect: {
x: error
y: 〈0;x〉("msg")
}
}
|