| ... | ... | @@ -2,6 +2,68 @@ const tests = @import("tests.zig"); |
| 2 | 2 | const builtin = @import("builtin"); |
| 3 | 3 | |
| 4 | 4 | pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5 | cases.add( |
| 6 | "bogus compile var", |
| 7 | \\const x = @import("builtin").bogus; |
| 8 | \\export fn entry() usize { return @sizeOf(@typeOf(x)); } |
| 9 | , |
| 10 | "tmp.zig:1:29: error: container 'builtin' has no member called 'bogus'", |
| 11 | ); |
| 12 | |
| 13 | cases.add( |
| 14 | "wrong panic signature, runtime function", |
| 15 | \\test "" {} |
| 16 | \\ |
| 17 | \\pub fn panic() void {} |
| 18 | \\ |
| 19 | , |
| 20 | "tmp.zig:3:5: error: expected type 'fn([]const u8, ?*builtin.StackTrace) noreturn', found 'fn() void'", |
| 21 | ); |
| 22 | |
| 23 | cases.add( |
| 24 | "wrong panic signature, generic function", |
| 25 | \\pub fn panic(comptime msg: []const u8, error_return_trace: ?*builtin.StackTrace) noreturn { |
| 26 | \\ while (true) {} |
| 27 | \\} |
| 28 | , |
| 29 | "tmp.zig:1:5: error: expected type 'fn([]const u8, ?*builtin.StackTrace) noreturn', found 'fn([]const u8,var)var'", |
| 30 | "tmp.zig:1:5: note: only one of the functions is generic", |
| 31 | ); |
| 32 | |
| 33 | cases.add( |
| 34 | "direct struct loop", |
| 35 | \\const A = struct { a : A, }; |
| 36 | \\export fn entry() usize { return @sizeOf(A); } |
| 37 | , |
| 38 | "tmp.zig:1:11: error: struct 'A' contains itself", |
| 39 | ); |
| 40 | |
| 41 | cases.add( |
| 42 | "indirect struct loop", |
| 43 | \\const A = struct { b : B, }; |
| 44 | \\const B = struct { c : C, }; |
| 45 | \\const C = struct { a : A, }; |
| 46 | \\export fn entry() usize { return @sizeOf(A); } |
| 47 | , |
| 48 | "tmp.zig:1:11: error: struct 'A' contains itself", |
| 49 | ); |
| 50 | |
| 51 | cases.add( |
| 52 | "instantiating an undefined value for an invalid struct that contains itself", |
| 53 | \\const Foo = struct { |
| 54 | \\ x: Foo, |
| 55 | \\}; |
| 56 | \\ |
| 57 | \\var foo: Foo = undefined; |
| 58 | \\ |
| 59 | \\export fn entry() usize { |
| 60 | \\ return @sizeOf(@typeOf(foo.x)); |
| 61 | \\} |
| 62 | , |
| 63 | "tmp.zig:1:13: error: struct 'Foo' contains itself", |
| 64 | "tmp.zig:8:28: note: referenced here", |
| 65 | ); |
| 66 | |
| 5 | 67 | cases.add( |
| 6 | 68 | "@typeInfo causing depend on itself compile error", |
| 7 | 69 | \\const start = struct { |
| ... | ... | @@ -16,7 +78,9 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 16 | 78 | \\ var boom = start.crash(); |
| 17 | 79 | \\} |
| 18 | 80 | , |
| 19 | | ".tmp_source.zig:2:5: error: 'crash' depends on itself", |
| 81 | "tmp.zig:7:9: error: dependency loop detected", |
| 82 | "tmp.zig:2:19: note: called from here", |
| 83 | "tmp.zig:10:21: note: referenced here", |
| 20 | 84 | ); |
| 21 | 85 | |
| 22 | 86 | cases.add( |
| ... | ... | @@ -29,7 +93,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 29 | 93 | \\ var s: Foo = Foo.E; |
| 30 | 94 | \\} |
| 31 | 95 | , |
| 32 | | ".tmp_source.zig:1:17: error: 'Foo' depends on itself", |
| 96 | "tmp.zig:1:17: error: 'Foo' depends on itself", |
| 33 | 97 | ); |
| 34 | 98 | |
| 35 | 99 | cases.add( |
| ... | ... | @@ -40,7 +104,9 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 40 | 104 | \\ const c = a + b; |
| 41 | 105 | \\} |
| 42 | 106 | , |
| 43 | | ".tmp_source.zig:1:1: error: 'a' depends on itself", |
| 107 | "tmp.zig:2:19: error: dependency loop detected", |
| 108 | "tmp.zig:1:19: note: referenced here", |
| 109 | "tmp.zig:4:15: note: referenced here", |
| 44 | 110 | ); |
| 45 | 111 | |
| 46 | 112 | cases.addTest( |
| ... | ... | @@ -59,7 +125,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 59 | 125 | \\const InvalidToken = struct {}; |
| 60 | 126 | \\const ExpectedVarDeclOrFn = struct {}; |
| 61 | 127 | , |
| 62 | | ".tmp_source.zig:4:9: error: not an enum type", |
| 128 | "tmp.zig:4:9: error: not an enum type", |
| 63 | 129 | ); |
| 64 | 130 | |
| 65 | 131 | cases.addTest( |
| ... | ... | @@ -70,7 +136,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 70 | 136 | \\ var x: AB = undefined; |
| 71 | 137 | \\} |
| 72 | 138 | , |
| 73 | | ".tmp_source.zig:2:18: error: invalid operands to binary expression: 'error{A}' and 'error{B}'", |
| 139 | "tmp.zig:2:18: error: invalid operands to binary expression: 'error{A}' and 'error{B}'", |
| 74 | 140 | ); |
| 75 | 141 | |
| 76 | 142 | if (builtin.os == builtin.Os.linux) { |
| ... | ... | @@ -81,7 +147,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 81 | 147 | \\ exit(0); |
| 82 | 148 | \\} |
| 83 | 149 | , |
| 84 | | ".tmp_source.zig:3:5: error: dependency on library c must be explicitly specified in the build command", |
| 150 | "tmp.zig:3:5: error: dependency on library c must be explicitly specified in the build command", |
| 85 | 151 | ); |
| 86 | 152 | |
| 87 | 153 | cases.addTest( |
| ... | ... | @@ -91,8 +157,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 91 | 157 | \\ _ = c.printf(c"hello, world!\n"); |
| 92 | 158 | \\} |
| 93 | 159 | , |
| 94 | | ".tmp_source.zig:1:11: error: C import failed", |
| 95 | | ".tmp_source.zig:1:11: note: libc headers not available; compilation does not link against libc", |
| 160 | "tmp.zig:1:11: error: C import failed", |
| 161 | "tmp.zig:1:11: note: libc headers not available; compilation does not link against libc", |
| 96 | 162 | ); |
| 97 | 163 | } |
| 98 | 164 | |
| ... | ... | @@ -104,8 +170,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 104 | 170 | \\ var x = a + b; |
| 105 | 171 | \\} |
| 106 | 172 | , |
| 107 | | ".tmp_source.zig:4:15: error: operation caused overflow", |
| 108 | | ".tmp_source.zig:4:15: note: when computing vector element at index 2", |
| 173 | "tmp.zig:4:15: error: operation caused overflow", |
| 174 | "tmp.zig:4:15: note: when computing vector element at index 2", |
| 109 | 175 | ); |
| 110 | 176 | |
| 111 | 177 | cases.addTest( |
| ... | ... | @@ -152,14 +218,14 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 152 | 218 | \\ B, |
| 153 | 219 | \\}; |
| 154 | 220 | , |
| 155 | | ".tmp_source.zig:2:5: error: type 'anyerror' not allowed in packed struct; no guaranteed in-memory representation", |
| 156 | | ".tmp_source.zig:5:5: error: array of 'u24' not allowed in packed struct due to padding bits", |
| 157 | | ".tmp_source.zig:8:5: error: type 'anyerror' not allowed in packed struct; no guaranteed in-memory representation", |
| 158 | | ".tmp_source.zig:11:5: error: non-packed, non-extern struct 'S' not allowed in packed struct; no guaranteed in-memory representation", |
| 159 | | ".tmp_source.zig:14:5: error: non-packed, non-extern struct 'U' not allowed in packed struct; no guaranteed in-memory representation", |
| 160 | | ".tmp_source.zig:17:5: error: type '?anyerror' not allowed in packed struct; no guaranteed in-memory representation", |
| 161 | | ".tmp_source.zig:20:5: error: type 'Enum' not allowed in packed struct; no guaranteed in-memory representation", |
| 162 | | ".tmp_source.zig:38:14: note: enum declaration does not specify an integer tag type", |
| 221 | "tmp.zig:2:5: error: type 'anyerror' not allowed in packed struct; no guaranteed in-memory representation", |
| 222 | "tmp.zig:5:5: error: array of 'u24' not allowed in packed struct due to padding bits", |
| 223 | "tmp.zig:8:5: error: type 'anyerror' not allowed in packed struct; no guaranteed in-memory representation", |
| 224 | "tmp.zig:11:5: error: non-packed, non-extern struct 'S' not allowed in packed struct; no guaranteed in-memory representation", |
| 225 | "tmp.zig:14:5: error: non-packed, non-extern struct 'U' not allowed in packed struct; no guaranteed in-memory representation", |
| 226 | "tmp.zig:17:5: error: type '?anyerror' not allowed in packed struct; no guaranteed in-memory representation", |
| 227 | "tmp.zig:20:5: error: type 'Enum' not allowed in packed struct; no guaranteed in-memory representation", |
| 228 | "tmp.zig:38:14: note: enum declaration does not specify an integer tag type", |
| 163 | 229 | ); |
| 164 | 230 | |
| 165 | 231 | cases.addCase(x: { |
| ... | ... | @@ -172,7 +238,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 172 | 238 | \\ x += 1; |
| 173 | 239 | \\} |
| 174 | 240 | , |
| 175 | | ".tmp_source.zig:2:5: error: use of undeclared identifier 'x'", |
| 241 | "tmp.zig:2:5: error: use of undeclared identifier 'x'", |
| 176 | 242 | ); |
| 177 | 243 | tc.expect_exact = true; |
| 178 | 244 | break :x tc; |
| ... | ... | @@ -184,7 +250,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 184 | 250 | \\ return 0; |
| 185 | 251 | \\} |
| 186 | 252 | , |
| 187 | | ".tmp_source.zig:1:15: error: parameter of type 'var' not allowed in function with calling convention 'ccc'", |
| 253 | "tmp.zig:1:15: error: parameter of type 'var' not allowed in function with calling convention 'ccc'", |
| 188 | 254 | ); |
| 189 | 255 | |
| 190 | 256 | cases.addTest( |
| ... | ... | @@ -194,7 +260,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 194 | 260 | \\ var y: [*c]c_void = x; |
| 195 | 261 | \\} |
| 196 | 262 | , |
| 197 | | ".tmp_source.zig:3:12: error: C pointers cannot point opaque types", |
| 263 | "tmp.zig:3:12: error: C pointers cannot point opaque types", |
| 198 | 264 | ); |
| 199 | 265 | |
| 200 | 266 | cases.addTest( |
| ... | ... | @@ -214,8 +280,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 214 | 280 | \\ var bar: Bar = undefined; |
| 215 | 281 | \\} |
| 216 | 282 | , |
| 217 | | ".tmp_source.zig:3:8: error: opaque types have unknown size and therefore cannot be directly embedded in structs", |
| 218 | | ".tmp_source.zig:7:10: error: opaque types have unknown size and therefore cannot be directly embedded in unions", |
| 283 | "tmp.zig:3:8: error: opaque types have unknown size and therefore cannot be directly embedded in structs", |
| 284 | "tmp.zig:7:10: error: opaque types have unknown size and therefore cannot be directly embedded in unions", |
| 219 | 285 | ); |
| 220 | 286 | |
| 221 | 287 | cases.addTest( |
| ... | ... | @@ -245,13 +311,13 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 245 | 311 | \\ var x: [*c]u32 = y; |
| 246 | 312 | \\} |
| 247 | 313 | , |
| 248 | | ".tmp_source.zig:3:27: error: cast increases pointer alignment", |
| 249 | | ".tmp_source.zig:7:18: error: cast discards const qualifier", |
| 250 | | ".tmp_source.zig:11:19: error: expected type '*u32', found '[*c]u8'", |
| 251 | | ".tmp_source.zig:11:19: note: pointer type child 'u8' cannot cast into pointer type child 'u32'", |
| 252 | | ".tmp_source.zig:15:22: error: cast increases pointer alignment", |
| 253 | | ".tmp_source.zig:19:21: error: cast discards const qualifier", |
| 254 | | ".tmp_source.zig:23:22: error: expected type '[*c]u32', found '*u8'", |
| 314 | "tmp.zig:3:27: error: cast increases pointer alignment", |
| 315 | "tmp.zig:7:18: error: cast discards const qualifier", |
| 316 | "tmp.zig:11:19: error: expected type '*u32', found '[*c]u8'", |
| 317 | "tmp.zig:11:19: note: pointer type child 'u8' cannot cast into pointer type child 'u32'", |
| 318 | "tmp.zig:15:22: error: cast increases pointer alignment", |
| 319 | "tmp.zig:19:21: error: cast discards const qualifier", |
| 320 | "tmp.zig:23:22: error: expected type '[*c]u32', found '*u8'", |
| 255 | 321 | ); |
| 256 | 322 | |
| 257 | 323 | cases.addTest( |
| ... | ... | @@ -261,7 +327,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 261 | 327 | \\ var zig_ptr: *u8 = c_ptr; |
| 262 | 328 | \\} |
| 263 | 329 | , |
| 264 | | ".tmp_source.zig:3:24: error: null pointer casted to type '*u8'", |
| 330 | "tmp.zig:3:24: error: null pointer casted to type '*u8'", |
| 265 | 331 | ); |
| 266 | 332 | |
| 267 | 333 | cases.addTest( |
| ... | ... | @@ -271,7 +337,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 271 | 337 | \\ var zig_ptr: *u8 = c_ptr; |
| 272 | 338 | \\} |
| 273 | 339 | , |
| 274 | | ".tmp_source.zig:3:24: error: use of undefined value here causes undefined behavior", |
| 340 | "tmp.zig:3:24: error: use of undefined value here causes undefined behavior", |
| 275 | 341 | ); |
| 276 | 342 | |
| 277 | 343 | cases.addTest( |
| ... | ... | @@ -291,12 +357,12 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 291 | 357 | \\ var c_ptr: [*c][*c]const u8 = ptr_opt_many_ptr; |
| 292 | 358 | \\} |
| 293 | 359 | , |
| 294 | | ".tmp_source.zig:6:24: error: expected type '*const [*]const u8', found '[*c]const [*c]const u8'", |
| 295 | | ".tmp_source.zig:6:24: note: pointer type child '[*c]const u8' cannot cast into pointer type child '[*]const u8'", |
| 296 | | ".tmp_source.zig:6:24: note: '[*c]const u8' could have null values which are illegal in type '[*]const u8'", |
| 297 | | ".tmp_source.zig:13:35: error: expected type '[*c][*c]const u8', found '*[*]u8'", |
| 298 | | ".tmp_source.zig:13:35: note: pointer type child '[*]u8' cannot cast into pointer type child '[*c]const u8'", |
| 299 | | ".tmp_source.zig:13:35: note: mutable '[*c]const u8' allows illegal null values stored to type '[*]u8'", |
| 360 | "tmp.zig:6:24: error: expected type '*const [*]const u8', found '[*c]const [*c]const u8'", |
| 361 | "tmp.zig:6:24: note: pointer type child '[*c]const u8' cannot cast into pointer type child '[*]const u8'", |
| 362 | "tmp.zig:6:24: note: '[*c]const u8' could have null values which are illegal in type '[*]const u8'", |
| 363 | "tmp.zig:13:35: error: expected type '[*c][*c]const u8', found '*[*]u8'", |
| 364 | "tmp.zig:13:35: note: pointer type child '[*]u8' cannot cast into pointer type child '[*c]const u8'", |
| 365 | "tmp.zig:13:35: note: mutable '[*c]const u8' allows illegal null values stored to type '[*]u8'", |
| 300 | 366 | ); |
| 301 | 367 | |
| 302 | 368 | cases.addTest( |
| ... | ... | @@ -309,8 +375,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 309 | 375 | \\ var ptr: [*c]u8 = x; |
| 310 | 376 | \\} |
| 311 | 377 | , |
| 312 | | ".tmp_source.zig:2:33: error: integer value 71615590737044764481 cannot be implicitly casted to type 'usize'", |
| 313 | | ".tmp_source.zig:6:23: error: integer type 'u65' too big for implicit @intToPtr to type '[*c]u8'", |
| 378 | "tmp.zig:2:33: error: integer value 71615590737044764481 cannot be implicitly casted to type 'usize'", |
| 379 | "tmp.zig:6:23: error: integer type 'u65' too big for implicit @intToPtr to type '[*c]u8'", |
| 314 | 380 | ); |
| 315 | 381 | |
| 316 | 382 | cases.addTest( |
| ... | ... | @@ -320,7 +386,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 320 | 386 | \\ const T = [*c]Foo; |
| 321 | 387 | \\} |
| 322 | 388 | , |
| 323 | | ".tmp_source.zig:3:15: error: C pointers cannot point to non-C-ABI-compatible type 'Foo'", |
| 389 | "tmp.zig:3:15: error: C pointers cannot point to non-C-ABI-compatible type 'Foo'", |
| 324 | 390 | ); |
| 325 | 391 | |
| 326 | 392 | cases.addCase(x: { |
| ... | ... | @@ -335,7 +401,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 335 | 401 | \\ inline while (i < n) : (i += 1) { @compileLog("!@#$"); } |
| 336 | 402 | \\} |
| 337 | 403 | , |
| 338 | | ".tmp_source.zig:7:39: error: found compile log statement", |
| 404 | "tmp.zig:7:39: error: found compile log statement", |
| 339 | 405 | ); |
| 340 | 406 | tc.expect_exact = true; |
| 341 | 407 | break :x tc; |
| ... | ... | @@ -347,7 +413,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 347 | 413 | \\ 'a'.* = 1; |
| 348 | 414 | \\} |
| 349 | 415 | , |
| 350 | | ".tmp_source.zig:2:8: error: attempt to dereference non-pointer type 'comptime_int'", |
| 416 | "tmp.zig:2:8: error: attempt to dereference non-pointer type 'comptime_int'", |
| 351 | 417 | ); |
| 352 | 418 | |
| 353 | 419 | cases.addTest( |
| ... | ... | @@ -356,7 +422,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 356 | 422 | \\ const x = 'a'.*[0..]; |
| 357 | 423 | \\} |
| 358 | 424 | , |
| 359 | | ".tmp_source.zig:2:18: error: attempt to dereference non-pointer type 'comptime_int'", |
| 425 | "tmp.zig:2:18: error: attempt to dereference non-pointer type 'comptime_int'", |
| 360 | 426 | ); |
| 361 | 427 | |
| 362 | 428 | cases.addTest( |
| ... | ... | @@ -365,14 +431,14 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 365 | 431 | \\ var z = @truncate(u8, u16(undefined)); |
| 366 | 432 | \\} |
| 367 | 433 | , |
| 368 | | ".tmp_source.zig:2:30: error: use of undefined value here causes undefined behavior", |
| 434 | "tmp.zig:2:30: error: use of undefined value here causes undefined behavior", |
| 369 | 435 | ); |
| 370 | 436 | |
| 371 | 437 | cases.addTest( |
| 372 | 438 | "return invalid type from test", |
| 373 | 439 | \\test "example" { return 1; } |
| 374 | 440 | , |
| 375 | | ".tmp_source.zig:1:25: error: integer value 1 cannot be implicitly casted to type 'void'", |
| 441 | "tmp.zig:1:25: error: integer value 1 cannot be implicitly casted to type 'void'", |
| 376 | 442 | ); |
| 377 | 443 | |
| 378 | 444 | cases.add( |
| ... | ... | @@ -382,7 +448,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 382 | 448 | \\ return x; |
| 383 | 449 | \\} |
| 384 | 450 | , |
| 385 | | ".tmp_source.zig:1:13: error: threadlocal variable cannot be constant", |
| 451 | "tmp.zig:1:13: error: threadlocal variable cannot be constant", |
| 386 | 452 | ); |
| 387 | 453 | |
| 388 | 454 | cases.add( |
| ... | ... | @@ -391,7 +457,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 391 | 457 | \\ threadlocal var x: i32 = 1234; |
| 392 | 458 | \\} |
| 393 | 459 | , |
| 394 | | ".tmp_source.zig:2:5: error: function-local variable 'x' cannot be threadlocal", |
| 460 | "tmp.zig:2:5: error: function-local variable 'x' cannot be threadlocal", |
| 395 | 461 | ); |
| 396 | 462 | |
| 397 | 463 | cases.add( |
| ... | ... | @@ -400,7 +466,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 400 | 466 | \\ var oops = @bitCast(u7, byte); |
| 401 | 467 | \\} |
| 402 | 468 | , |
| 403 | | ".tmp_source.zig:2:16: error: destination type 'u7' has 7 bits but source type 'u8' has 8 bits", |
| 469 | "tmp.zig:2:16: error: destination type 'u7' has 7 bits but source type 'u8' has 8 bits", |
| 404 | 470 | ); |
| 405 | 471 | |
| 406 | 472 | cases.add( |
| ... | ... | @@ -412,7 +478,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 412 | 478 | \\ return 5678; |
| 413 | 479 | \\} |
| 414 | 480 | , |
| 415 | | ".tmp_source.zig:2:12: error: `&&` is invalid. Note that `and` is boolean AND.", |
| 481 | "tmp.zig:2:12: error: `&&` is invalid. Note that `and` is boolean AND.", |
| 416 | 482 | ); |
| 417 | 483 | |
| 418 | 484 | cases.add( |
| ... | ... | @@ -424,8 +490,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 424 | 490 | \\ return 5678; |
| 425 | 491 | \\} |
| 426 | 492 | , |
| 427 | | ".tmp_source.zig:2:9: error: expected error set type, found 'bool'", |
| 428 | | ".tmp_source.zig:2:11: note: `||` merges error sets; `or` performs boolean OR", |
| 493 | "tmp.zig:2:9: error: expected error set type, found 'bool'", |
| 494 | "tmp.zig:2:11: note: `||` merges error sets; `or` performs boolean OR", |
| 429 | 495 | ); |
| 430 | 496 | |
| 431 | 497 | cases.add( |
| ... | ... | @@ -434,7 +500,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 434 | 500 | \\ @compileLog(@ptrCast(*const c_void, &entry)); |
| 435 | 501 | \\} |
| 436 | 502 | , |
| 437 | | ".tmp_source.zig:2:5: error: found compile log statement", |
| 503 | "tmp.zig:2:5: error: found compile log statement", |
| 438 | 504 | ); |
| 439 | 505 | |
| 440 | 506 | cases.add( |
| ... | ... | @@ -454,8 +520,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 454 | 520 | \\ }; |
| 455 | 521 | \\} |
| 456 | 522 | , |
| 457 | | ".tmp_source.zig:5:9: error: duplicate switch value", |
| 458 | | ".tmp_source.zig:12:9: error: duplicate switch value", |
| 523 | "tmp.zig:5:9: error: duplicate switch value", |
| 524 | "tmp.zig:12:9: error: duplicate switch value", |
| 459 | 525 | ); |
| 460 | 526 | |
| 461 | 527 | cases.add( |
| ... | ... | @@ -471,8 +537,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 471 | 537 | \\ }; |
| 472 | 538 | \\} |
| 473 | 539 | , |
| 474 | | ".tmp_source.zig:2:15: error: switch must handle all possibilities", |
| 475 | | ".tmp_source.zig:7:15: error: switch must handle all possibilities", |
| 540 | "tmp.zig:2:15: error: switch must handle all possibilities", |
| 541 | "tmp.zig:7:15: error: switch must handle all possibilities", |
| 476 | 542 | ); |
| 477 | 543 | |
| 478 | 544 | cases.add( |
| ... | ... | @@ -484,7 +550,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 484 | 550 | \\ const deref = int_ptr.*; |
| 485 | 551 | \\} |
| 486 | 552 | , |
| 487 | | ".tmp_source.zig:5:26: error: attempt to read 4 bytes from [4]u8 at index 1 which is 3 bytes", |
| 553 | "tmp.zig:5:26: error: attempt to read 4 bytes from [4]u8 at index 1 which is 3 bytes", |
| 488 | 554 | ); |
| 489 | 555 | |
| 490 | 556 | cases.add( |
| ... | ... | @@ -495,8 +561,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 495 | 561 | \\ do_the_thing(bar); |
| 496 | 562 | \\} |
| 497 | 563 | , |
| 498 | | ".tmp_source.zig:4:18: error: expected type 'fn(i32) void', found 'fn(bool) void", |
| 499 | | ".tmp_source.zig:4:18: note: parameter 0: 'bool' cannot cast into 'i32'", |
| 564 | "tmp.zig:4:18: error: expected type 'fn(i32) void', found 'fn(bool) void", |
| 565 | "tmp.zig:4:18: note: parameter 0: 'bool' cannot cast into 'i32'", |
| 500 | 566 | ); |
| 501 | 567 | |
| 502 | 568 | cases.add( |
| ... | ... | @@ -510,8 +576,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 510 | 576 | \\ const unsigned: u32 = value; |
| 511 | 577 | \\} |
| 512 | 578 | , |
| 513 | | ".tmp_source.zig:3:36: error: cannot cast negative value -1 to unsigned integer type 'u32'", |
| 514 | | ".tmp_source.zig:7:27: error: cannot cast negative value -1 to unsigned integer type 'u32'", |
| 579 | "tmp.zig:3:36: error: cannot cast negative value -1 to unsigned integer type 'u32'", |
| 580 | "tmp.zig:7:27: error: cannot cast negative value -1 to unsigned integer type 'u32'", |
| 515 | 581 | ); |
| 516 | 582 | |
| 517 | 583 | cases.add( |
| ... | ... | @@ -529,9 +595,9 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 529 | 595 | \\ var byte: u8 = spartan_count; |
| 530 | 596 | \\} |
| 531 | 597 | , |
| 532 | | ".tmp_source.zig:3:31: error: integer value 300 cannot be implicitly casted to type 'u8'", |
| 533 | | ".tmp_source.zig:7:22: error: integer value 300 cannot be implicitly casted to type 'u8'", |
| 534 | | ".tmp_source.zig:11:20: error: expected type 'u8', found 'u16'", |
| 598 | "tmp.zig:3:31: error: integer value 300 cannot be implicitly casted to type 'u8'", |
| 599 | "tmp.zig:7:22: error: integer value 300 cannot be implicitly casted to type 'u8'", |
| 600 | "tmp.zig:11:20: error: expected type 'u8', found 'u16'", |
| 535 | 601 | ); |
| 536 | 602 | |
| 537 | 603 | cases.add( |
| ... | ... | @@ -541,7 +607,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 541 | 607 | \\ const y: f32 = x; |
| 542 | 608 | \\} |
| 543 | 609 | , |
| 544 | | ".tmp_source.zig:3:20: error: cast of value 16777217.000000 to type 'f32' loses information", |
| 610 | "tmp.zig:3:20: error: cast of value 16777217.000000 to type 'f32' loses information", |
| 545 | 611 | ); |
| 546 | 612 | |
| 547 | 613 | cases.add( |
| ... | ... | @@ -551,7 +617,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 551 | 617 | \\ |
| 552 | 618 | \\export fn entry() usize { return @sizeOf(@typeOf(y)); } |
| 553 | 619 | , |
| 554 | | ".tmp_source.zig:2:14: error: expected type 'f32', found 'f64'", |
| 620 | "tmp.zig:2:14: error: expected type 'f32', found 'f64'", |
| 555 | 621 | ); |
| 556 | 622 | |
| 557 | 623 | cases.add( |
| ... | ... | @@ -563,28 +629,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 563 | 629 | \\ var x: i65536 = 1; |
| 564 | 630 | \\} |
| 565 | 631 | , |
| 566 | | ".tmp_source.zig:2:31: error: integer value 65536 cannot be implicitly casted to type 'u16'", |
| 567 | | ".tmp_source.zig:5:12: error: primitive integer type 'i65536' exceeds maximum bit width of 65535", |
| 568 | | ); |
| 569 | | |
| 570 | | cases.add( |
| 571 | | "wrong panic signature, runtime function", |
| 572 | | \\test "" {} |
| 573 | | \\ |
| 574 | | \\pub fn panic() void {} |
| 575 | | \\ |
| 576 | | , |
| 577 | | ".tmp_source.zig:3:5: error: expected type 'fn([]const u8, ?*StackTrace) noreturn', found 'fn() void'", |
| 578 | | ); |
| 579 | | |
| 580 | | cases.add( |
| 581 | | "wrong panic signature, generic function", |
| 582 | | \\pub fn panic(comptime msg: []const u8, error_return_trace: ?*builtin.StackTrace) noreturn { |
| 583 | | \\ while (true) {} |
| 584 | | \\} |
| 585 | | , |
| 586 | | ".tmp_source.zig:1:5: error: expected type 'fn([]const u8, ?*StackTrace) noreturn', found 'fn([]const u8,var)var'", |
| 587 | | ".tmp_source.zig:1:5: note: only one of the functions is generic", |
| 632 | "tmp.zig:2:31: error: integer value 65536 cannot be implicitly casted to type 'u16'", |
| 633 | "tmp.zig:5:12: error: primitive integer type 'i65536' exceeds maximum bit width of 65535", |
| 588 | 634 | ); |
| 589 | 635 | |
| 590 | 636 | cases.add( |
| ... | ... | @@ -597,7 +643,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 597 | 643 | \\ const car = Car.init(); |
| 598 | 644 | \\} |
| 599 | 645 | , |
| 600 | | ".tmp_source.zig:2:11: error: use of undeclared identifier 'SymbolThatDoesNotExist'", |
| 646 | "tmp.zig:2:11: error: use of undeclared identifier 'SymbolThatDoesNotExist'", |
| 601 | 647 | ); |
| 602 | 648 | |
| 603 | 649 | cases.add( |
| ... | ... | @@ -609,7 +655,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 609 | 655 | \\ var ptr2: *c_void = &b; |
| 610 | 656 | \\} |
| 611 | 657 | , |
| 612 | | ".tmp_source.zig:5:26: error: expected type '*c_void', found '**u32'", |
| 658 | "tmp.zig:5:26: error: expected type '*c_void', found '**u32'", |
| 613 | 659 | ); |
| 614 | 660 | |
| 615 | 661 | cases.add( |
| ... | ... | @@ -625,7 +671,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 625 | 671 | \\ const field = @typeInfo(Struct).Struct.fields[index]; |
| 626 | 672 | \\} |
| 627 | 673 | , |
| 628 | | ".tmp_source.zig:9:51: error: values of type 'StructField' must be comptime known, but index value is runtime known", |
| 674 | "tmp.zig:9:51: error: values of type 'builtin.StructField' must be comptime known, but index value is runtime known", |
| 629 | 675 | ); |
| 630 | 676 | |
| 631 | 677 | cases.add( |
| ... | ... | @@ -639,7 +685,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 639 | 685 | \\ _ = @typeName(Foo(i32)); |
| 640 | 686 | \\} |
| 641 | 687 | , |
| 642 | | ".tmp_source.zig:2:5: error: found compile log statement", |
| 688 | "tmp.zig:2:5: error: found compile log statement", |
| 643 | 689 | ); |
| 644 | 690 | |
| 645 | 691 | cases.add( |
| ... | ... | @@ -649,7 +695,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 649 | 695 | \\ var b = a[0..10]; |
| 650 | 696 | \\} |
| 651 | 697 | , |
| 652 | | ".tmp_source.zig:3:14: error: slice of undefined", |
| 698 | "tmp.zig:3:14: error: slice of undefined", |
| 653 | 699 | ); |
| 654 | 700 | |
| 655 | 701 | cases.add( |
| ... | ... | @@ -659,7 +705,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 659 | 705 | \\ const sliceA: []u8 = &buffer; |
| 660 | 706 | \\} |
| 661 | 707 | , |
| 662 | | ".tmp_source.zig:3:27: error: expected type '[]u8', found '*const [1]u8'", |
| 708 | "tmp.zig:3:27: error: expected type '[]u8', found '*const [1]u8'", |
| 663 | 709 | ); |
| 664 | 710 | |
| 665 | 711 | cases.add( |
| ... | ... | @@ -669,7 +715,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 669 | 715 | \\ _ = a.*.len; |
| 670 | 716 | \\} |
| 671 | 717 | , |
| 672 | | ".tmp_source.zig:3:10: error: attempt to dereference non-pointer type '[]u8'", |
| 718 | "tmp.zig:3:10: error: attempt to dereference non-pointer type '[]u8'", |
| 673 | 719 | ); |
| 674 | 720 | |
| 675 | 721 | cases.add( |
| ... | ... | @@ -680,9 +726,9 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 680 | 726 | \\ return p == null; |
| 681 | 727 | \\} |
| 682 | 728 | , |
| 683 | | ".tmp_source.zig:3:15: error: '*u0' and '?*u0' do not have the same in-memory representation", |
| 684 | | ".tmp_source.zig:3:31: note: '*u0' has no in-memory bits", |
| 685 | | ".tmp_source.zig:3:24: note: '?*u0' has in-memory bits", |
| 729 | "tmp.zig:3:15: error: '*u0' and '?*u0' do not have the same in-memory representation", |
| 730 | "tmp.zig:3:31: note: '*u0' has no in-memory bits", |
| 731 | "tmp.zig:3:24: note: '?*u0' has in-memory bits", |
| 686 | 732 | ); |
| 687 | 733 | |
| 688 | 734 | cases.add( |
| ... | ... | @@ -692,7 +738,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 692 | 738 | \\ _ = &x == null; |
| 693 | 739 | \\} |
| 694 | 740 | , |
| 695 | | ".tmp_source.zig:3:12: error: comparison against null can only be done with optionals", |
| 741 | "tmp.zig:3:12: error: comparison against null can only be done with optionals", |
| 696 | 742 | ); |
| 697 | 743 | |
| 698 | 744 | cases.add( |
| ... | ... | @@ -704,10 +750,10 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 704 | 750 | \\ const Errors = error{} || u16; |
| 705 | 751 | \\} |
| 706 | 752 | , |
| 707 | | ".tmp_source.zig:2:20: error: expected error set type, found type 'u8'", |
| 708 | | ".tmp_source.zig:2:23: note: `||` merges error sets; `or` performs boolean OR", |
| 709 | | ".tmp_source.zig:5:31: error: expected error set type, found type 'u16'", |
| 710 | | ".tmp_source.zig:5:28: note: `||` merges error sets; `or` performs boolean OR", |
| 753 | "tmp.zig:2:20: error: expected error set type, found type 'u8'", |
| 754 | "tmp.zig:2:23: note: `||` merges error sets; `or` performs boolean OR", |
| 755 | "tmp.zig:5:31: error: expected error set type, found type 'u16'", |
| 756 | "tmp.zig:5:28: note: `||` merges error sets; `or` performs boolean OR", |
| 711 | 757 | ); |
| 712 | 758 | |
| 713 | 759 | cases.add( |
| ... | ... | @@ -725,7 +771,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 725 | 771 | \\ const S = Gen(); |
| 726 | 772 | \\} |
| 727 | 773 | , |
| 728 | | ".tmp_source.zig:2:12: error: use of undeclared identifier 'T'", |
| 774 | "tmp.zig:2:12: error: use of undeclared identifier 'T'", |
| 729 | 775 | ); |
| 730 | 776 | |
| 731 | 777 | cases.add( |
| ... | ... | @@ -736,7 +782,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 736 | 782 | \\ f(i32); |
| 737 | 783 | \\} |
| 738 | 784 | , |
| 739 | | ".tmp_source.zig:4:5: error: use of undefined value here causes undefined behavior", |
| 785 | "tmp.zig:4:5: error: use of undefined value here causes undefined behavior", |
| 740 | 786 | ); |
| 741 | 787 | |
| 742 | 788 | cases.add( |
| ... | ... | @@ -754,9 +800,9 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 754 | 800 | \\ var x = func(3); |
| 755 | 801 | \\} |
| 756 | 802 | , |
| 757 | | ".tmp_source.zig:4:24: error: 'y' not accessible from inner function", |
| 758 | | ".tmp_source.zig:3:28: note: crossed function definition here", |
| 759 | | ".tmp_source.zig:1:10: note: declared here", |
| 803 | "tmp.zig:4:24: error: 'y' not accessible from inner function", |
| 804 | "tmp.zig:3:28: note: crossed function definition here", |
| 805 | "tmp.zig:1:10: note: declared here", |
| 760 | 806 | ); |
| 761 | 807 | |
| 762 | 808 | cases.add( |
| ... | ... | @@ -765,7 +811,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 765 | 811 | \\ const x = @intToFloat(f32, 1.1); |
| 766 | 812 | \\} |
| 767 | 813 | , |
| 768 | | ".tmp_source.zig:2:32: error: expected int type, found 'comptime_float'", |
| 814 | "tmp.zig:2:32: error: expected int type, found 'comptime_float'", |
| 769 | 815 | ); |
| 770 | 816 | |
| 771 | 817 | cases.add( |
| ... | ... | @@ -774,7 +820,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 774 | 820 | \\ const x = @floatToInt(i32, i32(54)); |
| 775 | 821 | \\} |
| 776 | 822 | , |
| 777 | | ".tmp_source.zig:2:35: error: expected float type, found 'i32'", |
| 823 | "tmp.zig:2:35: error: expected float type, found 'i32'", |
| 778 | 824 | ); |
| 779 | 825 | |
| 780 | 826 | cases.add( |
| ... | ... | @@ -783,7 +829,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 783 | 829 | \\ const x = @floatToInt(i8, 200); |
| 784 | 830 | \\} |
| 785 | 831 | , |
| 786 | | ".tmp_source.zig:2:31: error: integer value 200 cannot be implicitly casted to type 'i8'", |
| 832 | "tmp.zig:2:31: error: integer value 200 cannot be implicitly casted to type 'i8'", |
| 787 | 833 | ); |
| 788 | 834 | |
| 789 | 835 | cases.add( |
| ... | ... | @@ -795,7 +841,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 795 | 841 | \\ const int_val = int_ptr.*; |
| 796 | 842 | \\} |
| 797 | 843 | , |
| 798 | | ".tmp_source.zig:5:28: error: attempt to read 8 bytes from pointer to f32 which is 4 bytes", |
| 844 | "tmp.zig:5:28: error: attempt to read 8 bytes from pointer to f32 which is 4 bytes", |
| 799 | 845 | ); |
| 800 | 846 | |
| 801 | 847 | cases.add( |
| ... | ... | @@ -808,7 +854,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 808 | 854 | \\ const a = items[0]; |
| 809 | 855 | \\} |
| 810 | 856 | , |
| 811 | | ".tmp_source.zig:2:12: error: use of undeclared identifier 'SomeNonexistentType'", |
| 857 | "tmp.zig:2:12: error: use of undeclared identifier 'SomeNonexistentType'", |
| 812 | 858 | ); |
| 813 | 859 | |
| 814 | 860 | cases.add( |
| ... | ... | @@ -819,7 +865,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 819 | 865 | \\ @noInlineCall(foo); |
| 820 | 866 | \\} |
| 821 | 867 | , |
| 822 | | ".tmp_source.zig:4:5: error: no-inline call of inline function", |
| 868 | "tmp.zig:4:5: error: no-inline call of inline function", |
| 823 | 869 | ); |
| 824 | 870 | |
| 825 | 871 | cases.add( |
| ... | ... | @@ -836,8 +882,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 836 | 882 | \\ } |
| 837 | 883 | \\} |
| 838 | 884 | , |
| 839 | | ".tmp_source.zig:6:19: error: comptime control flow inside runtime block", |
| 840 | | ".tmp_source.zig:5:9: note: runtime block created here", |
| 885 | "tmp.zig:6:19: error: comptime control flow inside runtime block", |
| 886 | "tmp.zig:5:9: note: runtime block created here", |
| 841 | 887 | ); |
| 842 | 888 | |
| 843 | 889 | cases.add( |
| ... | ... | @@ -853,8 +899,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 853 | 899 | \\ } |
| 854 | 900 | \\} |
| 855 | 901 | , |
| 856 | | ".tmp_source.zig:6:13: error: comptime control flow inside runtime block", |
| 857 | | ".tmp_source.zig:5:9: note: runtime block created here", |
| 902 | "tmp.zig:6:13: error: comptime control flow inside runtime block", |
| 903 | "tmp.zig:5:9: note: runtime block created here", |
| 858 | 904 | ); |
| 859 | 905 | |
| 860 | 906 | cases.add( |
| ... | ... | @@ -868,8 +914,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 868 | 914 | \\ } |
| 869 | 915 | \\} |
| 870 | 916 | , |
| 871 | | ".tmp_source.zig:5:23: error: comptime control flow inside runtime block", |
| 872 | | ".tmp_source.zig:5:9: note: runtime block created here", |
| 917 | "tmp.zig:5:23: error: comptime control flow inside runtime block", |
| 918 | "tmp.zig:5:9: note: runtime block created here", |
| 873 | 919 | ); |
| 874 | 920 | |
| 875 | 921 | cases.add( |
| ... | ... | @@ -883,8 +929,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 883 | 929 | \\ } |
| 884 | 930 | \\} |
| 885 | 931 | , |
| 886 | | ".tmp_source.zig:5:25: error: comptime control flow inside runtime block", |
| 887 | | ".tmp_source.zig:5:9: note: runtime block created here", |
| 932 | "tmp.zig:5:25: error: comptime control flow inside runtime block", |
| 933 | "tmp.zig:5:9: note: runtime block created here", |
| 888 | 934 | ); |
| 889 | 935 | |
| 890 | 936 | cases.add( |
| ... | ... | @@ -898,8 +944,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 898 | 944 | \\ } |
| 899 | 945 | \\} |
| 900 | 946 | , |
| 901 | | ".tmp_source.zig:5:20: error: comptime control flow inside runtime block", |
| 902 | | ".tmp_source.zig:5:9: note: runtime block created here", |
| 947 | "tmp.zig:5:20: error: comptime control flow inside runtime block", |
| 948 | "tmp.zig:5:9: note: runtime block created here", |
| 903 | 949 | ); |
| 904 | 950 | |
| 905 | 951 | cases.add( |
| ... | ... | @@ -913,8 +959,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 913 | 959 | \\ } |
| 914 | 960 | \\} |
| 915 | 961 | , |
| 916 | | ".tmp_source.zig:5:20: error: comptime control flow inside runtime block", |
| 917 | | ".tmp_source.zig:5:9: note: runtime block created here", |
| 962 | "tmp.zig:5:20: error: comptime control flow inside runtime block", |
| 963 | "tmp.zig:5:9: note: runtime block created here", |
| 918 | 964 | ); |
| 919 | 965 | |
| 920 | 966 | cases.add( |
| ... | ... | @@ -928,8 +974,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 928 | 974 | \\ } |
| 929 | 975 | \\} |
| 930 | 976 | , |
| 931 | | ".tmp_source.zig:5:22: error: comptime control flow inside runtime block", |
| 932 | | ".tmp_source.zig:5:9: note: runtime block created here", |
| 977 | "tmp.zig:5:22: error: comptime control flow inside runtime block", |
| 978 | "tmp.zig:5:9: note: runtime block created here", |
| 933 | 979 | ); |
| 934 | 980 | |
| 935 | 981 | cases.add( |
| ... | ... | @@ -945,7 +991,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 945 | 991 | \\ }; |
| 946 | 992 | \\} |
| 947 | 993 | , |
| 948 | | ".tmp_source.zig:7:17: error: switch on type 'type' provides no expression parameter", |
| 994 | "tmp.zig:7:17: error: switch on type 'type' provides no expression parameter", |
| 949 | 995 | ); |
| 950 | 996 | |
| 951 | 997 | cases.add( |
| ... | ... | @@ -955,7 +1001,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 955 | 1001 | \\ foo(); |
| 956 | 1002 | \\} |
| 957 | 1003 | , |
| 958 | | ".tmp_source.zig:1:1: error: non-extern function has no body", |
| 1004 | "tmp.zig:1:1: error: non-extern function has no body", |
| 959 | 1005 | ); |
| 960 | 1006 | |
| 961 | 1007 | cases.add( |
| ... | ... | @@ -966,7 +1012,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 966 | 1012 | \\ return handle_undef == handle_dummy; |
| 967 | 1013 | \\} |
| 968 | 1014 | , |
| 969 | | ".tmp_source.zig:2:29: error: @handle() called outside of function definition", |
| 1015 | "tmp.zig:2:29: error: @handle() called outside of function definition", |
| 970 | 1016 | ); |
| 971 | 1017 | |
| 972 | 1018 | cases.add( |
| ... | ... | @@ -976,7 +1022,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 976 | 1022 | \\ return handle_undef == @handle(); |
| 977 | 1023 | \\} |
| 978 | 1024 | , |
| 979 | | ".tmp_source.zig:3:28: error: @handle() in non-async function", |
| 1025 | "tmp.zig:3:28: error: @handle() in non-async function", |
| 980 | 1026 | ); |
| 981 | 1027 | |
| 982 | 1028 | cases.add( |
| ... | ... | @@ -986,8 +1032,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 986 | 1032 | \\ return _; |
| 987 | 1033 | \\} |
| 988 | 1034 | , |
| 989 | | ".tmp_source.zig:2:5: error: `_` is not a declarable symbol", |
| 990 | | ".tmp_source.zig:3:12: error: use of undeclared identifier '_'", |
| 1035 | "tmp.zig:2:5: error: `_` is not a declarable symbol", |
| 1036 | "tmp.zig:3:12: error: use of undeclared identifier '_'", |
| 991 | 1037 | ); |
| 992 | 1038 | |
| 993 | 1039 | cases.add( |
| ... | ... | @@ -1000,7 +1046,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1000 | 1046 | \\ } |
| 1001 | 1047 | \\} |
| 1002 | 1048 | , |
| 1003 | | ".tmp_source.zig:4:20: error: use of undeclared identifier '_'", |
| 1049 | "tmp.zig:4:20: error: use of undeclared identifier '_'", |
| 1004 | 1050 | ); |
| 1005 | 1051 | |
| 1006 | 1052 | cases.add( |
| ... | ... | @@ -1016,7 +1062,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1016 | 1062 | \\ return 1; |
| 1017 | 1063 | \\} |
| 1018 | 1064 | , |
| 1019 | | ".tmp_source.zig:4:20: error: use of undeclared identifier '_'", |
| 1065 | "tmp.zig:4:20: error: use of undeclared identifier '_'", |
| 1020 | 1066 | ); |
| 1021 | 1067 | |
| 1022 | 1068 | cases.add( |
| ... | ... | @@ -1034,7 +1080,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1034 | 1080 | \\ return error.optionalReturnError; |
| 1035 | 1081 | \\} |
| 1036 | 1082 | , |
| 1037 | | ".tmp_source.zig:6:17: error: use of undeclared identifier '_'", |
| 1083 | "tmp.zig:6:17: error: use of undeclared identifier '_'", |
| 1038 | 1084 | ); |
| 1039 | 1085 | |
| 1040 | 1086 | cases.add( |
| ... | ... | @@ -1054,9 +1100,9 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1054 | 1100 | \\ while (x) |_| returns() else |_| unreachable; |
| 1055 | 1101 | \\} |
| 1056 | 1102 | , |
| 1057 | | ".tmp_source.zig:5:25: error: expression value is ignored", |
| 1058 | | ".tmp_source.zig:9:26: error: expression value is ignored", |
| 1059 | | ".tmp_source.zig:13:26: error: expression value is ignored", |
| 1103 | "tmp.zig:5:25: error: expression value is ignored", |
| 1104 | "tmp.zig:9:26: error: expression value is ignored", |
| 1105 | "tmp.zig:13:26: error: expression value is ignored", |
| 1060 | 1106 | ); |
| 1061 | 1107 | |
| 1062 | 1108 | cases.add( |
| ... | ... | @@ -1067,7 +1113,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1067 | 1113 | \\ dump(a); |
| 1068 | 1114 | \\} |
| 1069 | 1115 | , |
| 1070 | | ".tmp_source.zig:1:9: error: missing parameter name", |
| 1116 | "tmp.zig:1:9: error: missing parameter name", |
| 1071 | 1117 | ); |
| 1072 | 1118 | |
| 1073 | 1119 | cases.add( |
| ... | ... | @@ -1081,7 +1127,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1081 | 1127 | \\ for (xx) |f| {} |
| 1082 | 1128 | \\} |
| 1083 | 1129 | , |
| 1084 | | ".tmp_source.zig:7:15: error: variable of type 'Foo' must be const or comptime", |
| 1130 | "tmp.zig:7:15: error: variable of type 'Foo' must be const or comptime", |
| 1085 | 1131 | ); |
| 1086 | 1132 | |
| 1087 | 1133 | cases.add( |
| ... | ... | @@ -1092,7 +1138,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1092 | 1138 | \\ f(g); |
| 1093 | 1139 | \\} |
| 1094 | 1140 | , |
| 1095 | | ".tmp_source.zig:1:9: error: parameter of type 'fn(var)var' must be declared comptime", |
| 1141 | "tmp.zig:1:9: error: parameter of type 'fn(var)var' must be declared comptime", |
| 1096 | 1142 | ); |
| 1097 | 1143 | |
| 1098 | 1144 | cases.add( |
| ... | ... | @@ -1106,7 +1152,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1106 | 1152 | \\}; |
| 1107 | 1153 | \\export fn entry(bar: *Bar) void {} |
| 1108 | 1154 | , |
| 1109 | | ".tmp_source.zig:2:5: error: extern structs cannot contain fields of type '?*const void'", |
| 1155 | "tmp.zig:2:5: error: extern structs cannot contain fields of type '?*const void'", |
| 1110 | 1156 | ); |
| 1111 | 1157 | |
| 1112 | 1158 | cases.add( |
| ... | ... | @@ -1119,7 +1165,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1119 | 1165 | \\ command.exec(); |
| 1120 | 1166 | \\} |
| 1121 | 1167 | , |
| 1122 | | ".tmp_source.zig:6:12: error: use of undefined value here causes undefined behavior", |
| 1168 | "tmp.zig:6:12: error: use of undefined value here causes undefined behavior", |
| 1123 | 1169 | ); |
| 1124 | 1170 | |
| 1125 | 1171 | cases.add( |
| ... | ... | @@ -1132,7 +1178,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1132 | 1178 | \\ command.exec(); |
| 1133 | 1179 | \\} |
| 1134 | 1180 | , |
| 1135 | | ".tmp_source.zig:6:12: error: use of undefined value here causes undefined behavior", |
| 1181 | "tmp.zig:6:12: error: use of undefined value here causes undefined behavior", |
| 1136 | 1182 | ); |
| 1137 | 1183 | |
| 1138 | 1184 | cases.add( |
| ... | ... | @@ -1142,7 +1188,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1142 | 1188 | \\ const aligned = @alignCast(4, ptr); |
| 1143 | 1189 | \\} |
| 1144 | 1190 | , |
| 1145 | | ".tmp_source.zig:3:35: error: pointer address 0x1 is not aligned to 4 bytes", |
| 1191 | "tmp.zig:3:35: error: pointer address 0x1 is not aligned to 4 bytes", |
| 1146 | 1192 | ); |
| 1147 | 1193 | |
| 1148 | 1194 | cases.add( |
| ... | ... | @@ -1151,7 +1197,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1151 | 1197 | \\ return @ptrToInt(&{}) == @ptrToInt(&{}); |
| 1152 | 1198 | \\} |
| 1153 | 1199 | , |
| 1154 | | ".tmp_source.zig:2:23: error: pointer to size 0 type has no address", |
| 1200 | "tmp.zig:2:23: error: pointer to size 0 type has no address", |
| 1155 | 1201 | ); |
| 1156 | 1202 | |
| 1157 | 1203 | cases.add( |
| ... | ... | @@ -1160,7 +1206,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1160 | 1206 | \\ return @popCount(x); |
| 1161 | 1207 | \\} |
| 1162 | 1208 | , |
| 1163 | | ".tmp_source.zig:2:22: error: expected integer type, found 'f32'", |
| 1209 | "tmp.zig:2:22: error: expected integer type, found 'f32'", |
| 1164 | 1210 | ); |
| 1165 | 1211 | |
| 1166 | 1212 | cases.add( |
| ... | ... | @@ -1169,7 +1215,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1169 | 1215 | \\ _ = @popCount(-1); |
| 1170 | 1216 | \\} |
| 1171 | 1217 | , |
| 1172 | | ".tmp_source.zig:2:9: error: @popCount on negative comptime_int value -1", |
| 1218 | "tmp.zig:2:9: error: @popCount on negative comptime_int value -1", |
| 1173 | 1219 | ); |
| 1174 | 1220 | |
| 1175 | 1221 | cases.addCase(x: { |
| ... | ... | @@ -1185,8 +1231,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1185 | 1231 | \\ |
| 1186 | 1232 | \\fn bar(x: *b.Foo) void {} |
| 1187 | 1233 | , |
| 1188 | | ".tmp_source.zig:6:10: error: expected type '*Foo', found '*Foo'", |
| 1189 | | ".tmp_source.zig:6:10: note: pointer type child 'Foo' cannot cast into pointer type child 'Foo'", |
| 1234 | "tmp.zig:6:10: error: expected type '*Foo', found '*Foo'", |
| 1235 | "tmp.zig:6:10: note: pointer type child 'Foo' cannot cast into pointer type child 'Foo'", |
| 1190 | 1236 | "a.zig:1:17: note: Foo declared here", |
| 1191 | 1237 | "b.zig:1:17: note: Foo declared here", |
| 1192 | 1238 | ); |
| ... | ... | @@ -1218,9 +1264,9 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1218 | 1264 | \\ _ = @floatToInt(u8, f32(256.1)); |
| 1219 | 1265 | \\} |
| 1220 | 1266 | , |
| 1221 | | ".tmp_source.zig:2:9: error: integer value '-129' cannot be stored in type 'i8'", |
| 1222 | | ".tmp_source.zig:5:9: error: integer value '-1' cannot be stored in type 'u8'", |
| 1223 | | ".tmp_source.zig:8:9: error: integer value '256' cannot be stored in type 'u8'", |
| 1267 | "tmp.zig:2:9: error: integer value '-129' cannot be stored in type 'i8'", |
| 1268 | "tmp.zig:5:9: error: integer value '-1' cannot be stored in type 'u8'", |
| 1269 | "tmp.zig:8:9: error: integer value '256' cannot be stored in type 'u8'", |
| 1224 | 1270 | ); |
| 1225 | 1271 | |
| 1226 | 1272 | cases.add( |
| ... | ... | @@ -1229,7 +1275,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1229 | 1275 | \\ const a: fn () c_void = undefined; |
| 1230 | 1276 | \\} |
| 1231 | 1277 | , |
| 1232 | | ".tmp_source.zig:2:20: error: return type cannot be opaque", |
| 1278 | "tmp.zig:2:20: error: return type cannot be opaque", |
| 1233 | 1279 | ); |
| 1234 | 1280 | |
| 1235 | 1281 | cases.add( |
| ... | ... | @@ -1242,7 +1288,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1242 | 1288 | \\ var y = p.*; |
| 1243 | 1289 | \\} |
| 1244 | 1290 | , |
| 1245 | | ".tmp_source.zig:4:23: error: expected type '*?*i32', found '**i32'", |
| 1291 | "tmp.zig:4:23: error: expected type '*?*i32', found '**i32'", |
| 1246 | 1292 | ); |
| 1247 | 1293 | |
| 1248 | 1294 | cases.add( |
| ... | ... | @@ -1251,7 +1297,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1251 | 1297 | \\ const x: [*]const bool = true; |
| 1252 | 1298 | \\} |
| 1253 | 1299 | , |
| 1254 | | ".tmp_source.zig:2:30: error: expected type '[*]const bool', found 'bool'", |
| 1300 | "tmp.zig:2:30: error: expected type '[*]const bool', found 'bool'", |
| 1255 | 1301 | ); |
| 1256 | 1302 | |
| 1257 | 1303 | cases.add( |
| ... | ... | @@ -1260,7 +1306,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1260 | 1306 | \\ return x.*; |
| 1261 | 1307 | \\} |
| 1262 | 1308 | , |
| 1263 | | ".tmp_source.zig:2:13: error: index syntax required for unknown-length pointer type '[*]i32'", |
| 1309 | "tmp.zig:2:13: error: index syntax required for unknown-length pointer type '[*]i32'", |
| 1264 | 1310 | ); |
| 1265 | 1311 | |
| 1266 | 1312 | cases.add( |
| ... | ... | @@ -1273,14 +1319,14 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1273 | 1319 | \\ foo.a += 1; |
| 1274 | 1320 | \\} |
| 1275 | 1321 | , |
| 1276 | | ".tmp_source.zig:6:8: error: type '[*]Foo' does not support field access", |
| 1322 | "tmp.zig:6:8: error: type '[*]Foo' does not support field access", |
| 1277 | 1323 | ); |
| 1278 | 1324 | |
| 1279 | 1325 | cases.add( |
| 1280 | 1326 | "unknown length pointer to opaque", |
| 1281 | 1327 | \\export const T = [*]@OpaqueType(); |
| 1282 | 1328 | , |
| 1283 | | ".tmp_source.zig:1:18: error: unknown-length pointer to opaque", |
| 1329 | "tmp.zig:1:18: error: unknown-length pointer to opaque", |
| 1284 | 1330 | ); |
| 1285 | 1331 | |
| 1286 | 1332 | cases.add( |
| ... | ... | @@ -1296,7 +1342,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1296 | 1342 | \\ var rule_set = try Foo.init(); |
| 1297 | 1343 | \\} |
| 1298 | 1344 | , |
| 1299 | | ".tmp_source.zig:2:13: error: expected type 'i32', found 'type'", |
| 1345 | "tmp.zig:2:13: error: expected type 'i32', found 'type'", |
| 1300 | 1346 | ); |
| 1301 | 1347 | |
| 1302 | 1348 | cases.add( |
| ... | ... | @@ -1305,7 +1351,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1305 | 1351 | \\ const slice = ptr[0..2]; |
| 1306 | 1352 | \\} |
| 1307 | 1353 | , |
| 1308 | | ".tmp_source.zig:2:22: error: slice of single-item pointer", |
| 1354 | "tmp.zig:2:22: error: slice of single-item pointer", |
| 1309 | 1355 | ); |
| 1310 | 1356 | |
| 1311 | 1357 | cases.add( |
| ... | ... | @@ -1314,7 +1360,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1314 | 1360 | \\ return ptr[1]; |
| 1315 | 1361 | \\} |
| 1316 | 1362 | , |
| 1317 | | ".tmp_source.zig:2:15: error: index of single-item pointer", |
| 1363 | "tmp.zig:2:15: error: index of single-item pointer", |
| 1318 | 1364 | ); |
| 1319 | 1365 | |
| 1320 | 1366 | cases.add( |
| ... | ... | @@ -1330,10 +1376,10 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1330 | 1376 | \\ return null; |
| 1331 | 1377 | \\} |
| 1332 | 1378 | , |
| 1333 | | ".tmp_source.zig:5:34: error: expected type '?NextError!i32', found '?OtherError!i32'", |
| 1334 | | ".tmp_source.zig:5:34: note: optional type child 'OtherError!i32' cannot cast into optional type child 'NextError!i32'", |
| 1335 | | ".tmp_source.zig:5:34: note: error set 'OtherError' cannot cast into error set 'NextError'", |
| 1336 | | ".tmp_source.zig:2:26: note: 'error.OutOfMemory' not a member of destination error set", |
| 1379 | "tmp.zig:5:34: error: expected type '?NextError!i32', found '?OtherError!i32'", |
| 1380 | "tmp.zig:5:34: note: optional type child 'OtherError!i32' cannot cast into optional type child 'NextError!i32'", |
| 1381 | "tmp.zig:5:34: note: error set 'OtherError' cannot cast into error set 'NextError'", |
| 1382 | "tmp.zig:2:26: note: 'error.OutOfMemory' not a member of destination error set", |
| 1337 | 1383 | ); |
| 1338 | 1384 | |
| 1339 | 1385 | cases.add( |
| ... | ... | @@ -1350,14 +1396,14 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1350 | 1396 | \\ Filled, |
| 1351 | 1397 | \\}; |
| 1352 | 1398 | , |
| 1353 | | ".tmp_source.zig:3:17: error: attempt to dereference non-pointer type 'Tile'", |
| 1399 | "tmp.zig:3:17: error: attempt to dereference non-pointer type 'Tile'", |
| 1354 | 1400 | ); |
| 1355 | 1401 | |
| 1356 | 1402 | cases.add( |
| 1357 | 1403 | "invalid field access in comptime", |
| 1358 | 1404 | \\comptime { var x = doesnt_exist.whatever; } |
| 1359 | 1405 | , |
| 1360 | | ".tmp_source.zig:1:20: error: use of undeclared identifier 'doesnt_exist'", |
| 1406 | "tmp.zig:1:20: error: use of undeclared identifier 'doesnt_exist'", |
| 1361 | 1407 | ); |
| 1362 | 1408 | |
| 1363 | 1409 | cases.add( |
| ... | ... | @@ -1378,8 +1424,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1378 | 1424 | \\ } |
| 1379 | 1425 | \\} |
| 1380 | 1426 | , |
| 1381 | | ".tmp_source.zig:12:9: error: cannot suspend inside suspend block", |
| 1382 | | ".tmp_source.zig:11:5: note: other suspend block here", |
| 1427 | "tmp.zig:12:9: error: cannot suspend inside suspend block", |
| 1428 | "tmp.zig:11:5: note: other suspend block here", |
| 1383 | 1429 | ); |
| 1384 | 1430 | |
| 1385 | 1431 | cases.add( |
| ... | ... | @@ -1389,8 +1435,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1389 | 1435 | \\} |
| 1390 | 1436 | \\inline fn b() void { } |
| 1391 | 1437 | , |
| 1392 | | ".tmp_source.zig:2:5: error: functions marked inline must be stored in const or comptime var", |
| 1393 | | ".tmp_source.zig:4:1: note: declared here", |
| 1438 | "tmp.zig:2:5: error: functions marked inline must be stored in const or comptime var", |
| 1439 | "tmp.zig:4:1: note: declared here", |
| 1394 | 1440 | ); |
| 1395 | 1441 | |
| 1396 | 1442 | cases.add( |
| ... | ... | @@ -1400,7 +1446,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1400 | 1446 | \\ @panic(e); |
| 1401 | 1447 | \\} |
| 1402 | 1448 | , |
| 1403 | | ".tmp_source.zig:3:12: error: expected type '[]const u8', found 'error{Foo}'", |
| 1449 | "tmp.zig:3:12: error: expected type '[]const u8', found 'error{Foo}'", |
| 1404 | 1450 | ); |
| 1405 | 1451 | |
| 1406 | 1452 | cases.add( |
| ... | ... | @@ -1414,8 +1460,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1414 | 1460 | \\ var tagName = @tagName(fi); |
| 1415 | 1461 | \\} |
| 1416 | 1462 | , |
| 1417 | | ".tmp_source.zig:7:19: error: union has no associated enum", |
| 1418 | | ".tmp_source.zig:1:18: note: declared here", |
| 1463 | "tmp.zig:7:19: error: union has no associated enum", |
| 1464 | "tmp.zig:1:18: note: declared here", |
| 1419 | 1465 | ); |
| 1420 | 1466 | |
| 1421 | 1467 | cases.add( |
| ... | ... | @@ -1428,7 +1474,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1428 | 1474 | \\ return error.ShouldBeCompileError; |
| 1429 | 1475 | \\} |
| 1430 | 1476 | , |
| 1431 | | ".tmp_source.zig:6:17: error: expected type 'void', found 'error{ShouldBeCompileError}'", |
| 1477 | "tmp.zig:6:17: error: expected type 'void', found 'error{ShouldBeCompileError}'", |
| 1432 | 1478 | ); |
| 1433 | 1479 | |
| 1434 | 1480 | cases.add( |
| ... | ... | @@ -1437,7 +1483,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1437 | 1483 | \\ var s = (struct{v: var}){.v=i32(10)}; |
| 1438 | 1484 | \\} |
| 1439 | 1485 | , |
| 1440 | | ".tmp_source.zig:2:23: error: invalid token: 'var'", |
| 1486 | "tmp.zig:2:23: error: invalid token: 'var'", |
| 1441 | 1487 | ); |
| 1442 | 1488 | |
| 1443 | 1489 | cases.add( |
| ... | ... | @@ -1447,7 +1493,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1447 | 1493 | \\ const y = @ptrCast(*i32, &x); |
| 1448 | 1494 | \\} |
| 1449 | 1495 | , |
| 1450 | | ".tmp_source.zig:3:15: error: cast discards const qualifier", |
| 1496 | "tmp.zig:3:15: error: cast discards const qualifier", |
| 1451 | 1497 | ); |
| 1452 | 1498 | |
| 1453 | 1499 | cases.add( |
| ... | ... | @@ -1456,7 +1502,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1456 | 1502 | \\ const slice = ([*]i32)(undefined)[0..1]; |
| 1457 | 1503 | \\} |
| 1458 | 1504 | , |
| 1459 | | ".tmp_source.zig:2:38: error: non-zero length slice of undefined pointer", |
| 1505 | "tmp.zig:2:38: error: non-zero length slice of undefined pointer", |
| 1460 | 1506 | ); |
| 1461 | 1507 | |
| 1462 | 1508 | cases.add( |
| ... | ... | @@ -1471,7 +1517,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1471 | 1517 | \\ a(c); |
| 1472 | 1518 | \\} |
| 1473 | 1519 | , |
| 1474 | | ".tmp_source.zig:8:7: error: expected type 'fn(*const u8) void', found 'fn(u8) void'", |
| 1520 | "tmp.zig:8:7: error: expected type 'fn(*const u8) void', found 'fn(u8) void'", |
| 1475 | 1521 | ); |
| 1476 | 1522 | |
| 1477 | 1523 | cases.add( |
| ... | ... | @@ -1485,7 +1531,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1485 | 1531 | \\ } |
| 1486 | 1532 | \\} |
| 1487 | 1533 | , |
| 1488 | | ".tmp_source.zig:5:5: error: else prong required when switching on type 'anyerror'", |
| 1534 | "tmp.zig:5:5: error: else prong required when switching on type 'anyerror'", |
| 1489 | 1535 | ); |
| 1490 | 1536 | |
| 1491 | 1537 | cases.add( |
| ... | ... | @@ -1496,7 +1542,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1496 | 1542 | \\fn foo() !void { |
| 1497 | 1543 | \\} |
| 1498 | 1544 | , |
| 1499 | | ".tmp_source.zig:4:11: error: function with inferred error set must return at least one possible error", |
| 1545 | "tmp.zig:4:11: error: function with inferred error set must return at least one possible error", |
| 1500 | 1546 | ); |
| 1501 | 1547 | |
| 1502 | 1548 | cases.add( |
| ... | ... | @@ -1515,8 +1561,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1515 | 1561 | \\ } |
| 1516 | 1562 | \\} |
| 1517 | 1563 | , |
| 1518 | | ".tmp_source.zig:2:26: error: error.Baz not handled in switch", |
| 1519 | | ".tmp_source.zig:2:26: error: error.Bar not handled in switch", |
| 1564 | "tmp.zig:2:26: error: error.Baz not handled in switch", |
| 1565 | "tmp.zig:2:26: error: error.Bar not handled in switch", |
| 1520 | 1566 | ); |
| 1521 | 1567 | |
| 1522 | 1568 | cases.add( |
| ... | ... | @@ -1537,8 +1583,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1537 | 1583 | \\ } |
| 1538 | 1584 | \\} |
| 1539 | 1585 | , |
| 1540 | | ".tmp_source.zig:5:14: error: duplicate switch value: '@typeOf(foo).ReturnType.ErrorSet.Foo'", |
| 1541 | | ".tmp_source.zig:3:14: note: other value is here", |
| 1586 | "tmp.zig:5:14: error: duplicate switch value: '@typeOf(foo).ReturnType.ErrorSet.Foo'", |
| 1587 | "tmp.zig:3:14: note: other value is here", |
| 1542 | 1588 | ); |
| 1543 | 1589 | |
| 1544 | 1590 | cases.add("invalid cast from integral type to enum", |
| ... | ... | @@ -1553,7 +1599,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1553 | 1599 | \\ E.One => {}, |
| 1554 | 1600 | \\ } |
| 1555 | 1601 | \\} |
| 1556 | | , ".tmp_source.zig:9:10: error: expected type 'usize', found 'E'"); |
| 1602 | , "tmp.zig:9:10: error: expected type 'usize', found 'E'"); |
| 1557 | 1603 | |
| 1558 | 1604 | cases.add( |
| 1559 | 1605 | "range operator in switch used on error set", |
| ... | ... | @@ -1571,7 +1617,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1571 | 1617 | \\ } |
| 1572 | 1618 | \\} |
| 1573 | 1619 | , |
| 1574 | | ".tmp_source.zig:3:17: error: operator not allowed for errors", |
| 1620 | "tmp.zig:3:17: error: operator not allowed for errors", |
| 1575 | 1621 | ); |
| 1576 | 1622 | |
| 1577 | 1623 | cases.add( |
| ... | ... | @@ -1580,7 +1626,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1580 | 1626 | \\ const z: ?fn()!void = null; |
| 1581 | 1627 | \\} |
| 1582 | 1628 | , |
| 1583 | | ".tmp_source.zig:2:15: error: inferring error set of return type valid only for function definitions", |
| 1629 | "tmp.zig:2:15: error: inferring error set of return type valid only for function definitions", |
| 1584 | 1630 | ); |
| 1585 | 1631 | |
| 1586 | 1632 | cases.add( |
| ... | ... | @@ -1590,7 +1636,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1590 | 1636 | \\ const z = Foo.Bar; |
| 1591 | 1637 | \\} |
| 1592 | 1638 | , |
| 1593 | | ".tmp_source.zig:3:18: error: no error named 'Bar' in 'Foo'", |
| 1639 | "tmp.zig:3:18: error: no error named 'Bar' in 'Foo'", |
| 1594 | 1640 | ); |
| 1595 | 1641 | |
| 1596 | 1642 | cases.add( |
| ... | ... | @@ -1599,7 +1645,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1599 | 1645 | \\ const z = i32!i32; |
| 1600 | 1646 | \\} |
| 1601 | 1647 | , |
| 1602 | | ".tmp_source.zig:2:15: error: expected error set type, found type 'i32'", |
| 1648 | "tmp.zig:2:15: error: expected error set type, found type 'i32'", |
| 1603 | 1649 | ); |
| 1604 | 1650 | |
| 1605 | 1651 | cases.add( |
| ... | ... | @@ -1615,7 +1661,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1615 | 1661 | \\ } |
| 1616 | 1662 | \\} |
| 1617 | 1663 | , |
| 1618 | | ".tmp_source.zig:7:11: error: error sets 'Set1' and 'Set2' have no common errors", |
| 1664 | "tmp.zig:7:11: error: error sets 'Set1' and 'Set2' have no common errors", |
| 1619 | 1665 | ); |
| 1620 | 1666 | |
| 1621 | 1667 | cases.add( |
| ... | ... | @@ -1624,7 +1670,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1624 | 1670 | \\ const z = error.A > error.B; |
| 1625 | 1671 | \\} |
| 1626 | 1672 | , |
| 1627 | | ".tmp_source.zig:2:23: error: operator not allowed for errors", |
| 1673 | "tmp.zig:2:23: error: operator not allowed for errors", |
| 1628 | 1674 | ); |
| 1629 | 1675 | |
| 1630 | 1676 | cases.add( |
| ... | ... | @@ -1636,7 +1682,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1636 | 1682 | \\ var y = @errSetCast(Set2, x); |
| 1637 | 1683 | \\} |
| 1638 | 1684 | , |
| 1639 | | ".tmp_source.zig:5:13: error: error.B not a member of error set 'Set2'", |
| 1685 | "tmp.zig:5:13: error: error.B not a member of error set 'Set2'", |
| 1640 | 1686 | ); |
| 1641 | 1687 | |
| 1642 | 1688 | cases.add( |
| ... | ... | @@ -1649,9 +1695,9 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1649 | 1695 | \\ return error.B; |
| 1650 | 1696 | \\} |
| 1651 | 1697 | , |
| 1652 | | ".tmp_source.zig:3:35: error: expected type 'SmallErrorSet!i32', found 'anyerror!i32'", |
| 1653 | | ".tmp_source.zig:3:35: note: error set 'anyerror' cannot cast into error set 'SmallErrorSet'", |
| 1654 | | ".tmp_source.zig:3:35: note: cannot cast global error set into smaller set", |
| 1698 | "tmp.zig:3:35: error: expected type 'SmallErrorSet!i32', found 'anyerror!i32'", |
| 1699 | "tmp.zig:3:35: note: error set 'anyerror' cannot cast into error set 'SmallErrorSet'", |
| 1700 | "tmp.zig:3:35: note: cannot cast global error set into smaller set", |
| 1655 | 1701 | ); |
| 1656 | 1702 | |
| 1657 | 1703 | cases.add( |
| ... | ... | @@ -1664,10 +1710,9 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1664 | 1710 | \\ return error.B; |
| 1665 | 1711 | \\} |
| 1666 | 1712 | , |
| 1667 | | ".tmp_source.zig:3:31: error: expected type 'SmallErrorSet', found 'anyerror'", |
| 1668 | | ".tmp_source.zig:3:31: note: cannot cast global error set into smaller set", |
| 1713 | "tmp.zig:3:31: error: expected type 'SmallErrorSet', found 'anyerror'", |
| 1714 | "tmp.zig:3:31: note: cannot cast global error set into smaller set", |
| 1669 | 1715 | ); |
| 1670 | | |
| 1671 | 1716 | cases.add( |
| 1672 | 1717 | "recursive inferred error set", |
| 1673 | 1718 | \\export fn entry() void { |
| ... | ... | @@ -1677,7 +1722,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1677 | 1722 | \\ try foo(); |
| 1678 | 1723 | \\} |
| 1679 | 1724 | , |
| 1680 | | ".tmp_source.zig:5:5: error: cannot resolve inferred error set '@typeOf(foo).ReturnType.ErrorSet': function 'foo' not fully analyzed yet", |
| 1725 | "tmp.zig:5:5: error: cannot resolve inferred error set '@typeOf(foo).ReturnType.ErrorSet': function 'foo' not fully analyzed yet", |
| 1681 | 1726 | ); |
| 1682 | 1727 | |
| 1683 | 1728 | cases.add( |
| ... | ... | @@ -1691,8 +1736,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1691 | 1736 | \\ var x: Set2 = set1; |
| 1692 | 1737 | \\} |
| 1693 | 1738 | , |
| 1694 | | ".tmp_source.zig:7:19: error: expected type 'Set2', found 'Set1'", |
| 1695 | | ".tmp_source.zig:1:23: note: 'error.B' not a member of destination error set", |
| 1739 | "tmp.zig:7:19: error: expected type 'Set2', found 'Set1'", |
| 1740 | "tmp.zig:1:23: note: 'error.B' not a member of destination error set", |
| 1696 | 1741 | ); |
| 1697 | 1742 | |
| 1698 | 1743 | cases.add( |
| ... | ... | @@ -1706,7 +1751,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1706 | 1751 | \\ var y = @intToError(x); |
| 1707 | 1752 | \\} |
| 1708 | 1753 | , |
| 1709 | | ".tmp_source.zig:7:13: error: integer value 3 represents no error", |
| 1754 | "tmp.zig:7:13: error: integer value 3 represents no error", |
| 1710 | 1755 | ); |
| 1711 | 1756 | |
| 1712 | 1757 | cases.add( |
| ... | ... | @@ -1724,7 +1769,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1724 | 1769 | \\ var y = @errSetCast(Set2, @intToError(x)); |
| 1725 | 1770 | \\} |
| 1726 | 1771 | , |
| 1727 | | ".tmp_source.zig:11:13: error: error.B not a member of error set 'Set2'", |
| 1772 | "tmp.zig:11:13: error: error.B not a member of error set 'Set2'", |
| 1728 | 1773 | ); |
| 1729 | 1774 | |
| 1730 | 1775 | cases.add( |
| ... | ... | @@ -1733,7 +1778,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1733 | 1778 | \\ _ = @memberCount(anyerror); |
| 1734 | 1779 | \\} |
| 1735 | 1780 | , |
| 1736 | | ".tmp_source.zig:2:9: error: global error set member count not available at comptime", |
| 1781 | "tmp.zig:2:9: error: global error set member count not available at comptime", |
| 1737 | 1782 | ); |
| 1738 | 1783 | |
| 1739 | 1784 | cases.add( |
| ... | ... | @@ -1746,8 +1791,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1746 | 1791 | \\ const a: Foo = undefined; |
| 1747 | 1792 | \\} |
| 1748 | 1793 | , |
| 1749 | | ".tmp_source.zig:3:5: error: duplicate error: 'Bar'", |
| 1750 | | ".tmp_source.zig:2:5: note: other error here", |
| 1794 | "tmp.zig:3:5: error: duplicate error: 'Bar'", |
| 1795 | "tmp.zig:2:5: note: other error here", |
| 1751 | 1796 | ); |
| 1752 | 1797 | |
| 1753 | 1798 | cases.add( |
| ... | ... | @@ -1756,7 +1801,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1756 | 1801 | \\ const x = usize(-10); |
| 1757 | 1802 | \\} |
| 1758 | 1803 | , |
| 1759 | | ".tmp_source.zig:2:21: error: cannot cast negative value -10 to unsigned integer type 'usize'", |
| 1804 | "tmp.zig:2:21: error: cannot cast negative value -10 to unsigned integer type 'usize'", |
| 1760 | 1805 | ); |
| 1761 | 1806 | |
| 1762 | 1807 | cases.add( |
| ... | ... | @@ -1766,7 +1811,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1766 | 1811 | \\ var arr: [v]u8 = undefined; |
| 1767 | 1812 | \\} |
| 1768 | 1813 | , |
| 1769 | | ".tmp_source.zig:1:1: error: unable to infer variable type", |
| 1814 | "tmp.zig:1:1: error: unable to infer variable type", |
| 1770 | 1815 | ); |
| 1771 | 1816 | |
| 1772 | 1817 | cases.add( |
| ... | ... | @@ -1779,8 +1824,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1779 | 1824 | \\ const a: Foo = undefined; |
| 1780 | 1825 | \\} |
| 1781 | 1826 | , |
| 1782 | | ".tmp_source.zig:3:5: error: duplicate struct field: 'Bar'", |
| 1783 | | ".tmp_source.zig:2:5: note: other field here", |
| 1827 | "tmp.zig:3:5: error: duplicate struct field: 'Bar'", |
| 1828 | "tmp.zig:2:5: note: other field here", |
| 1784 | 1829 | ); |
| 1785 | 1830 | |
| 1786 | 1831 | cases.add( |
| ... | ... | @@ -1793,8 +1838,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1793 | 1838 | \\ const a: Foo = undefined; |
| 1794 | 1839 | \\} |
| 1795 | 1840 | , |
| 1796 | | ".tmp_source.zig:3:5: error: duplicate union field: 'Bar'", |
| 1797 | | ".tmp_source.zig:2:5: note: other field here", |
| 1841 | "tmp.zig:3:5: error: duplicate union field: 'Bar'", |
| 1842 | "tmp.zig:2:5: note: other field here", |
| 1798 | 1843 | ); |
| 1799 | 1844 | |
| 1800 | 1845 | cases.add( |
| ... | ... | @@ -1808,8 +1853,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1808 | 1853 | \\ const a: Foo = undefined; |
| 1809 | 1854 | \\} |
| 1810 | 1855 | , |
| 1811 | | ".tmp_source.zig:3:5: error: duplicate enum field: 'Bar'", |
| 1812 | | ".tmp_source.zig:2:5: note: other field here", |
| 1856 | "tmp.zig:3:5: error: duplicate enum field: 'Bar'", |
| 1857 | "tmp.zig:2:5: note: other field here", |
| 1813 | 1858 | ); |
| 1814 | 1859 | |
| 1815 | 1860 | cases.add( |
| ... | ... | @@ -1819,15 +1864,15 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1819 | 1864 | \\} |
| 1820 | 1865 | \\nakedcc fn foo() void { } |
| 1821 | 1866 | , |
| 1822 | | ".tmp_source.zig:2:5: error: unable to call function with naked calling convention", |
| 1823 | | ".tmp_source.zig:4:1: note: declared here", |
| 1867 | "tmp.zig:2:5: error: unable to call function with naked calling convention", |
| 1868 | "tmp.zig:4:1: note: declared here", |
| 1824 | 1869 | ); |
| 1825 | 1870 | |
| 1826 | 1871 | cases.add( |
| 1827 | 1872 | "function with invalid return type", |
| 1828 | 1873 | \\export fn foo() boid {} |
| 1829 | 1874 | , |
| 1830 | | ".tmp_source.zig:1:17: error: use of undeclared identifier 'boid'", |
| 1875 | "tmp.zig:1:17: error: use of undeclared identifier 'boid'", |
| 1831 | 1876 | ); |
| 1832 | 1877 | |
| 1833 | 1878 | cases.add( |
| ... | ... | @@ -1835,7 +1880,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1835 | 1880 | \\const Foo = enum { A, B, C }; |
| 1836 | 1881 | \\export fn entry(foo: Foo) void { } |
| 1837 | 1882 | , |
| 1838 | | ".tmp_source.zig:2:22: error: parameter of type 'Foo' not allowed in function with calling convention 'ccc'", |
| 1883 | "tmp.zig:2:22: error: parameter of type 'Foo' not allowed in function with calling convention 'ccc'", |
| 1839 | 1884 | ); |
| 1840 | 1885 | |
| 1841 | 1886 | cases.add( |
| ... | ... | @@ -1847,7 +1892,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1847 | 1892 | \\}; |
| 1848 | 1893 | \\export fn entry(foo: Foo) void { } |
| 1849 | 1894 | , |
| 1850 | | ".tmp_source.zig:6:22: error: parameter of type 'Foo' not allowed in function with calling convention 'ccc'", |
| 1895 | "tmp.zig:6:22: error: parameter of type 'Foo' not allowed in function with calling convention 'ccc'", |
| 1851 | 1896 | ); |
| 1852 | 1897 | |
| 1853 | 1898 | cases.add( |
| ... | ... | @@ -1859,7 +1904,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1859 | 1904 | \\}; |
| 1860 | 1905 | \\export fn entry(foo: Foo) void { } |
| 1861 | 1906 | , |
| 1862 | | ".tmp_source.zig:6:22: error: parameter of type 'Foo' not allowed in function with calling convention 'ccc'", |
| 1907 | "tmp.zig:6:22: error: parameter of type 'Foo' not allowed in function with calling convention 'ccc'", |
| 1863 | 1908 | ); |
| 1864 | 1909 | |
| 1865 | 1910 | cases.add( |
| ... | ... | @@ -1871,7 +1916,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1871 | 1916 | \\ switch (f) {} |
| 1872 | 1917 | \\} |
| 1873 | 1918 | , |
| 1874 | | ".tmp_source.zig:5:5: error: enumeration value 'Foo.M' not handled in switch", |
| 1919 | "tmp.zig:5:5: error: enumeration value 'Foo.M' not handled in switch", |
| 1875 | 1920 | ); |
| 1876 | 1921 | |
| 1877 | 1922 | cases.add( |
| ... | ... | @@ -1880,7 +1925,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1880 | 1925 | \\ var a = 1 >> -1; |
| 1881 | 1926 | \\} |
| 1882 | 1927 | , |
| 1883 | | ".tmp_source.zig:2:18: error: shift by negative value -1", |
| 1928 | "tmp.zig:2:18: error: shift by negative value -1", |
| 1884 | 1929 | ); |
| 1885 | 1930 | |
| 1886 | 1931 | cases.add( |
| ... | ... | @@ -1891,7 +1936,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1891 | 1936 | \\ } |
| 1892 | 1937 | \\} |
| 1893 | 1938 | , |
| 1894 | | ".tmp_source.zig:3:9: error: encountered @panic at compile-time", |
| 1939 | "tmp.zig:3:9: error: encountered @panic at compile-time", |
| 1895 | 1940 | ); |
| 1896 | 1941 | |
| 1897 | 1942 | cases.add( |
| ... | ... | @@ -1921,7 +1966,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1921 | 1966 | \\ bogus; |
| 1922 | 1967 | \\} |
| 1923 | 1968 | , |
| 1924 | | ".tmp_source.zig:8:5: error: use of undeclared identifier 'bogus'", |
| 1969 | "tmp.zig:8:5: error: use of undeclared identifier 'bogus'", |
| 1925 | 1970 | ); |
| 1926 | 1971 | |
| 1927 | 1972 | cases.add( |
| ... | ... | @@ -1934,7 +1979,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1934 | 1979 | \\ } |
| 1935 | 1980 | \\} |
| 1936 | 1981 | , |
| 1937 | | ".tmp_source.zig:4:13: error: label not found: 'outer'", |
| 1982 | "tmp.zig:4:13: error: label not found: 'outer'", |
| 1938 | 1983 | ); |
| 1939 | 1984 | |
| 1940 | 1985 | cases.add( |
| ... | ... | @@ -1948,7 +1993,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1948 | 1993 | \\ } |
| 1949 | 1994 | \\} |
| 1950 | 1995 | , |
| 1951 | | ".tmp_source.zig:5:13: error: labeled loop not found: 'outer'", |
| 1996 | "tmp.zig:5:13: error: labeled loop not found: 'outer'", |
| 1952 | 1997 | ); |
| 1953 | 1998 | |
| 1954 | 1999 | cases.add( |
| ... | ... | @@ -1961,8 +2006,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1961 | 2006 | \\ |
| 1962 | 2007 | \\extern fn bar(x: *void) void { } |
| 1963 | 2008 | , |
| 1964 | | ".tmp_source.zig:1:30: error: parameter of type '*void' has 0 bits; not allowed in function with calling convention 'ccc'", |
| 1965 | | ".tmp_source.zig:7:18: error: parameter of type '*void' has 0 bits; not allowed in function with calling convention 'ccc'", |
| 2009 | "tmp.zig:1:30: error: parameter of type '*void' has 0 bits; not allowed in function with calling convention 'ccc'", |
| 2010 | "tmp.zig:7:18: error: parameter of type '*void' has 0 bits; not allowed in function with calling convention 'ccc'", |
| 1966 | 2011 | ); |
| 1967 | 2012 | |
| 1968 | 2013 | cases.add( |
| ... | ... | @@ -1974,7 +2019,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1974 | 2019 | \\ var bad = {}; |
| 1975 | 2020 | \\} |
| 1976 | 2021 | , |
| 1977 | | ".tmp_source.zig:5:5: error: expected token ';', found 'var'", |
| 2022 | "tmp.zig:5:5: error: expected token ';', found 'var'", |
| 1978 | 2023 | ); |
| 1979 | 2024 | |
| 1980 | 2025 | cases.add( |
| ... | ... | @@ -1986,7 +2031,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1986 | 2031 | \\ var bad = {}; |
| 1987 | 2032 | \\} |
| 1988 | 2033 | , |
| 1989 | | ".tmp_source.zig:5:5: error: expected token ';', found 'var'", |
| 2034 | "tmp.zig:5:5: error: expected token ';', found 'var'", |
| 1990 | 2035 | ); |
| 1991 | 2036 | |
| 1992 | 2037 | cases.add( |
| ... | ... | @@ -1998,7 +2043,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 1998 | 2043 | \\ var bad = {}; |
| 1999 | 2044 | \\} |
| 2000 | 2045 | , |
| 2001 | | ".tmp_source.zig:5:5: error: expected token ';', found 'var'", |
| 2046 | "tmp.zig:5:5: error: expected token ';', found 'var'", |
| 2002 | 2047 | ); |
| 2003 | 2048 | |
| 2004 | 2049 | cases.add( |
| ... | ... | @@ -2010,7 +2055,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2010 | 2055 | \\ var bad = {}; |
| 2011 | 2056 | \\} |
| 2012 | 2057 | , |
| 2013 | | ".tmp_source.zig:5:5: error: expected token ';', found 'var'", |
| 2058 | "tmp.zig:5:5: error: expected token ';', found 'var'", |
| 2014 | 2059 | ); |
| 2015 | 2060 | |
| 2016 | 2061 | cases.add( |
| ... | ... | @@ -2022,7 +2067,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2022 | 2067 | \\ var bad = {}; |
| 2023 | 2068 | \\} |
| 2024 | 2069 | , |
| 2025 | | ".tmp_source.zig:5:5: error: expected token ';', found 'var'", |
| 2070 | "tmp.zig:5:5: error: expected token ';', found 'var'", |
| 2026 | 2071 | ); |
| 2027 | 2072 | |
| 2028 | 2073 | cases.add( |
| ... | ... | @@ -2034,7 +2079,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2034 | 2079 | \\ var bad = {}; |
| 2035 | 2080 | \\} |
| 2036 | 2081 | , |
| 2037 | | ".tmp_source.zig:5:5: error: expected token ';', found 'var'", |
| 2082 | "tmp.zig:5:5: error: expected token ';', found 'var'", |
| 2038 | 2083 | ); |
| 2039 | 2084 | |
| 2040 | 2085 | cases.add( |
| ... | ... | @@ -2046,7 +2091,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2046 | 2091 | \\ var bad = {}; |
| 2047 | 2092 | \\} |
| 2048 | 2093 | , |
| 2049 | | ".tmp_source.zig:5:5: error: expected token ';', found 'var'", |
| 2094 | "tmp.zig:5:5: error: expected token ';', found 'var'", |
| 2050 | 2095 | ); |
| 2051 | 2096 | |
| 2052 | 2097 | cases.add( |
| ... | ... | @@ -2058,7 +2103,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2058 | 2103 | \\ var bad = {}; |
| 2059 | 2104 | \\} |
| 2060 | 2105 | , |
| 2061 | | ".tmp_source.zig:5:5: error: expected token ';', found 'var'", |
| 2106 | "tmp.zig:5:5: error: expected token ';', found 'var'", |
| 2062 | 2107 | ); |
| 2063 | 2108 | |
| 2064 | 2109 | cases.add( |
| ... | ... | @@ -2070,7 +2115,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2070 | 2115 | \\ var bad = {}; |
| 2071 | 2116 | \\} |
| 2072 | 2117 | , |
| 2073 | | ".tmp_source.zig:5:5: error: expected token ';', found 'var'", |
| 2118 | "tmp.zig:5:5: error: expected token ';', found 'var'", |
| 2074 | 2119 | ); |
| 2075 | 2120 | |
| 2076 | 2121 | cases.add( |
| ... | ... | @@ -2082,7 +2127,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2082 | 2127 | \\ var bad = {}; |
| 2083 | 2128 | \\} |
| 2084 | 2129 | , |
| 2085 | | ".tmp_source.zig:5:5: error: expected token ';', found 'var'", |
| 2130 | "tmp.zig:5:5: error: expected token ';', found 'var'", |
| 2086 | 2131 | ); |
| 2087 | 2132 | |
| 2088 | 2133 | cases.add( |
| ... | ... | @@ -2094,7 +2139,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2094 | 2139 | \\ var bad = {}; |
| 2095 | 2140 | \\} |
| 2096 | 2141 | , |
| 2097 | | ".tmp_source.zig:5:5: error: expected token ';', found 'var'", |
| 2142 | "tmp.zig:5:5: error: expected token ';', found 'var'", |
| 2098 | 2143 | ); |
| 2099 | 2144 | |
| 2100 | 2145 | cases.add( |
| ... | ... | @@ -2106,7 +2151,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2106 | 2151 | \\ var bad = {}; |
| 2107 | 2152 | \\} |
| 2108 | 2153 | , |
| 2109 | | ".tmp_source.zig:5:5: error: expected token ';', found 'var'", |
| 2154 | "tmp.zig:5:5: error: expected token ';', found 'var'", |
| 2110 | 2155 | ); |
| 2111 | 2156 | |
| 2112 | 2157 | cases.add( |
| ... | ... | @@ -2118,7 +2163,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2118 | 2163 | \\ var bad = {}; |
| 2119 | 2164 | \\} |
| 2120 | 2165 | , |
| 2121 | | ".tmp_source.zig:5:5: error: expected token ';', found 'var'", |
| 2166 | "tmp.zig:5:5: error: expected token ';', found 'var'", |
| 2122 | 2167 | ); |
| 2123 | 2168 | |
| 2124 | 2169 | cases.add( |
| ... | ... | @@ -2130,7 +2175,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2130 | 2175 | \\ var bad = {}; |
| 2131 | 2176 | \\} |
| 2132 | 2177 | , |
| 2133 | | ".tmp_source.zig:5:5: error: expected token ';', found 'var'", |
| 2178 | "tmp.zig:5:5: error: expected token ';', found 'var'", |
| 2134 | 2179 | ); |
| 2135 | 2180 | |
| 2136 | 2181 | cases.add( |
| ... | ... | @@ -2142,7 +2187,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2142 | 2187 | \\ var bad = {}; |
| 2143 | 2188 | \\} |
| 2144 | 2189 | , |
| 2145 | | ".tmp_source.zig:5:5: error: expected token ';', found 'var'", |
| 2190 | "tmp.zig:5:5: error: expected token ';', found 'var'", |
| 2146 | 2191 | ); |
| 2147 | 2192 | |
| 2148 | 2193 | cases.add( |
| ... | ... | @@ -2154,7 +2199,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2154 | 2199 | \\ var bad = {}; |
| 2155 | 2200 | \\} |
| 2156 | 2201 | , |
| 2157 | | ".tmp_source.zig:5:5: error: expected token ';', found 'var'", |
| 2202 | "tmp.zig:5:5: error: expected token ';', found 'var'", |
| 2158 | 2203 | ); |
| 2159 | 2204 | |
| 2160 | 2205 | cases.add( |
| ... | ... | @@ -2166,7 +2211,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2166 | 2211 | \\ var bad = {}; |
| 2167 | 2212 | \\} |
| 2168 | 2213 | , |
| 2169 | | ".tmp_source.zig:5:5: error: expected token ';', found 'var'", |
| 2214 | "tmp.zig:5:5: error: expected token ';', found 'var'", |
| 2170 | 2215 | ); |
| 2171 | 2216 | |
| 2172 | 2217 | cases.add( |
| ... | ... | @@ -2178,7 +2223,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2178 | 2223 | \\ var bad = {}; |
| 2179 | 2224 | \\} |
| 2180 | 2225 | , |
| 2181 | | ".tmp_source.zig:5:5: error: expected token ';', found 'var'", |
| 2226 | "tmp.zig:5:5: error: expected token ';', found 'var'", |
| 2182 | 2227 | ); |
| 2183 | 2228 | |
| 2184 | 2229 | cases.add( |
| ... | ... | @@ -2190,7 +2235,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2190 | 2235 | \\ var bad = {}; |
| 2191 | 2236 | \\} |
| 2192 | 2237 | , |
| 2193 | | ".tmp_source.zig:5:5: error: expected token ';', found 'var'", |
| 2238 | "tmp.zig:5:5: error: expected token ';', found 'var'", |
| 2194 | 2239 | ); |
| 2195 | 2240 | |
| 2196 | 2241 | cases.add( |
| ... | ... | @@ -2202,7 +2247,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2202 | 2247 | \\ var bad = {}; |
| 2203 | 2248 | \\} |
| 2204 | 2249 | , |
| 2205 | | ".tmp_source.zig:5:5: error: expected token ';', found 'var'", |
| 2250 | "tmp.zig:5:5: error: expected token ';', found 'var'", |
| 2206 | 2251 | ); |
| 2207 | 2252 | |
| 2208 | 2253 | cases.add( |
| ... | ... | @@ -2214,7 +2259,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2214 | 2259 | \\ var bad = {}; |
| 2215 | 2260 | \\} |
| 2216 | 2261 | , |
| 2217 | | ".tmp_source.zig:5:5: error: expected token ';', found 'var'", |
| 2262 | "tmp.zig:5:5: error: expected token ';', found 'var'", |
| 2218 | 2263 | ); |
| 2219 | 2264 | |
| 2220 | 2265 | cases.add( |
| ... | ... | @@ -2223,7 +2268,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2223 | 2268 | \\fn a() void {} |
| 2224 | 2269 | \\export fn entry() void { a(); } |
| 2225 | 2270 | , |
| 2226 | | ".tmp_source.zig:2:1: error: redefinition of 'a'", |
| 2271 | "tmp.zig:2:1: error: redefinition of 'a'", |
| 2227 | 2272 | ); |
| 2228 | 2273 | |
| 2229 | 2274 | cases.add( |
| ... | ... | @@ -2231,7 +2276,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2231 | 2276 | \\fn a() noreturn {return;} |
| 2232 | 2277 | \\export fn entry() void { a(); } |
| 2233 | 2278 | , |
| 2234 | | ".tmp_source.zig:1:18: error: expected type 'noreturn', found 'void'", |
| 2279 | "tmp.zig:1:18: error: expected type 'noreturn', found 'void'", |
| 2235 | 2280 | ); |
| 2236 | 2281 | |
| 2237 | 2282 | cases.add( |
| ... | ... | @@ -2239,7 +2284,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2239 | 2284 | \\fn a() i32 {} |
| 2240 | 2285 | \\export fn entry() void { _ = a(); } |
| 2241 | 2286 | , |
| 2242 | | ".tmp_source.zig:1:12: error: expected type 'i32', found 'void'", |
| 2287 | "tmp.zig:1:12: error: expected type 'i32', found 'void'", |
| 2243 | 2288 | ); |
| 2244 | 2289 | |
| 2245 | 2290 | cases.add( |
| ... | ... | @@ -2248,7 +2293,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2248 | 2293 | \\ b(); |
| 2249 | 2294 | \\} |
| 2250 | 2295 | , |
| 2251 | | ".tmp_source.zig:2:5: error: use of undeclared identifier 'b'", |
| 2296 | "tmp.zig:2:5: error: use of undeclared identifier 'b'", |
| 2252 | 2297 | ); |
| 2253 | 2298 | |
| 2254 | 2299 | cases.add( |
| ... | ... | @@ -2258,7 +2303,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2258 | 2303 | \\} |
| 2259 | 2304 | \\fn b(a: i32, b: i32, c: i32) void { } |
| 2260 | 2305 | , |
| 2261 | | ".tmp_source.zig:2:6: error: expected 3 arguments, found 1", |
| 2306 | "tmp.zig:2:6: error: expected 3 arguments, found 1", |
| 2262 | 2307 | ); |
| 2263 | 2308 | |
| 2264 | 2309 | cases.add( |
| ... | ... | @@ -2266,7 +2311,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2266 | 2311 | \\fn a() bogus {} |
| 2267 | 2312 | \\export fn entry() void { _ = a(); } |
| 2268 | 2313 | , |
| 2269 | | ".tmp_source.zig:1:8: error: use of undeclared identifier 'bogus'", |
| 2314 | "tmp.zig:1:8: error: use of undeclared identifier 'bogus'", |
| 2270 | 2315 | ); |
| 2271 | 2316 | |
| 2272 | 2317 | cases.add( |
| ... | ... | @@ -2274,7 +2319,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2274 | 2319 | \\fn a() *noreturn {} |
| 2275 | 2320 | \\export fn entry() void { _ = a(); } |
| 2276 | 2321 | , |
| 2277 | | ".tmp_source.zig:1:8: error: pointer to noreturn not allowed", |
| 2322 | "tmp.zig:1:8: error: pointer to noreturn not allowed", |
| 2278 | 2323 | ); |
| 2279 | 2324 | |
| 2280 | 2325 | cases.add( |
| ... | ... | @@ -2286,7 +2331,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2286 | 2331 | \\ |
| 2287 | 2332 | \\fn b() void {} |
| 2288 | 2333 | , |
| 2289 | | ".tmp_source.zig:3:5: error: unreachable code", |
| 2334 | "tmp.zig:3:5: error: unreachable code", |
| 2290 | 2335 | ); |
| 2291 | 2336 | |
| 2292 | 2337 | cases.add( |
| ... | ... | @@ -2294,7 +2339,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2294 | 2339 | \\const bogus = @import("bogus-does-not-exist.zig",); |
| 2295 | 2340 | \\export fn entry() void { bogus.bogo(); } |
| 2296 | 2341 | , |
| 2297 | | ".tmp_source.zig:1:15: error: unable to find 'bogus-does-not-exist.zig'", |
| 2342 | "tmp.zig:1:15: error: unable to find 'bogus-does-not-exist.zig'", |
| 2298 | 2343 | ); |
| 2299 | 2344 | |
| 2300 | 2345 | cases.add( |
| ... | ... | @@ -2305,8 +2350,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2305 | 2350 | \\ c; |
| 2306 | 2351 | \\} |
| 2307 | 2352 | , |
| 2308 | | ".tmp_source.zig:3:5: error: use of undeclared identifier 'b'", |
| 2309 | | ".tmp_source.zig:4:5: error: use of undeclared identifier 'c'", |
| 2353 | "tmp.zig:3:5: error: use of undeclared identifier 'b'", |
| 2354 | "tmp.zig:4:5: error: use of undeclared identifier 'c'", |
| 2310 | 2355 | ); |
| 2311 | 2356 | |
| 2312 | 2357 | cases.add( |
| ... | ... | @@ -2315,7 +2360,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2315 | 2360 | \\} |
| 2316 | 2361 | \\export fn entry() void { f(1, 2); } |
| 2317 | 2362 | , |
| 2318 | | ".tmp_source.zig:1:15: error: redeclaration of variable 'a'", |
| 2363 | "tmp.zig:1:15: error: redeclaration of variable 'a'", |
| 2319 | 2364 | ); |
| 2320 | 2365 | |
| 2321 | 2366 | cases.add( |
| ... | ... | @@ -2325,7 +2370,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2325 | 2370 | \\ const a = 0; |
| 2326 | 2371 | \\} |
| 2327 | 2372 | , |
| 2328 | | ".tmp_source.zig:3:5: error: redeclaration of variable 'a'", |
| 2373 | "tmp.zig:3:5: error: redeclaration of variable 'a'", |
| 2329 | 2374 | ); |
| 2330 | 2375 | |
| 2331 | 2376 | cases.add( |
| ... | ... | @@ -2335,7 +2380,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2335 | 2380 | \\} |
| 2336 | 2381 | \\export fn entry() void { f(1); } |
| 2337 | 2382 | , |
| 2338 | | ".tmp_source.zig:2:5: error: redeclaration of variable 'a'", |
| 2383 | "tmp.zig:2:5: error: redeclaration of variable 'a'", |
| 2339 | 2384 | ); |
| 2340 | 2385 | |
| 2341 | 2386 | cases.add( |
| ... | ... | @@ -2345,7 +2390,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2345 | 2390 | \\ return a; |
| 2346 | 2391 | \\} |
| 2347 | 2392 | , |
| 2348 | | ".tmp_source.zig:3:12: error: expected type 'i32', found '[*]const u8'", |
| 2393 | "tmp.zig:3:12: error: expected type 'i32', found '[*]const u8'", |
| 2349 | 2394 | ); |
| 2350 | 2395 | |
| 2351 | 2396 | cases.add( |
| ... | ... | @@ -2354,7 +2399,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2354 | 2399 | \\ if (0) {} |
| 2355 | 2400 | \\} |
| 2356 | 2401 | , |
| 2357 | | ".tmp_source.zig:2:9: error: expected type 'bool', found 'comptime_int'", |
| 2402 | "tmp.zig:2:9: error: expected type 'bool', found 'comptime_int'", |
| 2358 | 2403 | ); |
| 2359 | 2404 | |
| 2360 | 2405 | cases.add( |
| ... | ... | @@ -2363,7 +2408,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2363 | 2408 | \\ const a = return; |
| 2364 | 2409 | \\} |
| 2365 | 2410 | , |
| 2366 | | ".tmp_source.zig:2:5: error: unreachable code", |
| 2411 | "tmp.zig:2:5: error: unreachable code", |
| 2367 | 2412 | ); |
| 2368 | 2413 | |
| 2369 | 2414 | cases.add( |
| ... | ... | @@ -2372,7 +2417,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2372 | 2417 | \\ const a: noreturn = {}; |
| 2373 | 2418 | \\} |
| 2374 | 2419 | , |
| 2375 | | ".tmp_source.zig:2:14: error: variable of type 'noreturn' not allowed", |
| 2420 | "tmp.zig:2:14: error: variable of type 'noreturn' not allowed", |
| 2376 | 2421 | ); |
| 2377 | 2422 | |
| 2378 | 2423 | cases.add( |
| ... | ... | @@ -2380,7 +2425,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2380 | 2425 | \\fn f(a: noreturn) void {} |
| 2381 | 2426 | \\export fn entry() void { f(); } |
| 2382 | 2427 | , |
| 2383 | | ".tmp_source.zig:1:9: error: parameter of type 'noreturn' not allowed", |
| 2428 | "tmp.zig:1:9: error: parameter of type 'noreturn' not allowed", |
| 2384 | 2429 | ); |
| 2385 | 2430 | |
| 2386 | 2431 | cases.add( |
| ... | ... | @@ -2389,7 +2434,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2389 | 2434 | \\ 3 = 3; |
| 2390 | 2435 | \\} |
| 2391 | 2436 | , |
| 2392 | | ".tmp_source.zig:2:7: error: cannot assign to constant", |
| 2437 | "tmp.zig:2:7: error: cannot assign to constant", |
| 2393 | 2438 | ); |
| 2394 | 2439 | |
| 2395 | 2440 | cases.add( |
| ... | ... | @@ -2399,7 +2444,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2399 | 2444 | \\ a = 4; |
| 2400 | 2445 | \\} |
| 2401 | 2446 | , |
| 2402 | | ".tmp_source.zig:3:7: error: cannot assign to constant", |
| 2447 | "tmp.zig:3:7: error: cannot assign to constant", |
| 2403 | 2448 | ); |
| 2404 | 2449 | |
| 2405 | 2450 | cases.add( |
| ... | ... | @@ -2408,7 +2453,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2408 | 2453 | \\ b = 3; |
| 2409 | 2454 | \\} |
| 2410 | 2455 | , |
| 2411 | | ".tmp_source.zig:2:5: error: use of undeclared identifier 'b'", |
| 2456 | "tmp.zig:2:5: error: use of undeclared identifier 'b'", |
| 2412 | 2457 | ); |
| 2413 | 2458 | |
| 2414 | 2459 | cases.add( |
| ... | ... | @@ -2417,7 +2462,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2417 | 2462 | \\ (const a = 0); |
| 2418 | 2463 | \\} |
| 2419 | 2464 | , |
| 2420 | | ".tmp_source.zig:2:6: error: invalid token: 'const'", |
| 2465 | "tmp.zig:2:6: error: invalid token: 'const'", |
| 2421 | 2466 | ); |
| 2422 | 2467 | |
| 2423 | 2468 | cases.add( |
| ... | ... | @@ -2426,7 +2471,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2426 | 2471 | \\ i[i] = i[i]; |
| 2427 | 2472 | \\} |
| 2428 | 2473 | , |
| 2429 | | ".tmp_source.zig:2:5: error: use of undeclared identifier 'i'", |
| 2474 | "tmp.zig:2:5: error: use of undeclared identifier 'i'", |
| 2430 | 2475 | ); |
| 2431 | 2476 | |
| 2432 | 2477 | cases.add( |
| ... | ... | @@ -2436,8 +2481,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2436 | 2481 | \\ bad[bad] = bad[bad]; |
| 2437 | 2482 | \\} |
| 2438 | 2483 | , |
| 2439 | | ".tmp_source.zig:3:8: error: array access of non-array type 'bool'", |
| 2440 | | ".tmp_source.zig:3:19: error: array access of non-array type 'bool'", |
| 2484 | "tmp.zig:3:8: error: array access of non-array type 'bool'", |
| 2485 | "tmp.zig:3:19: error: array access of non-array type 'bool'", |
| 2441 | 2486 | ); |
| 2442 | 2487 | |
| 2443 | 2488 | cases.add( |
| ... | ... | @@ -2448,8 +2493,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2448 | 2493 | \\ array[bad] = array[bad]; |
| 2449 | 2494 | \\} |
| 2450 | 2495 | , |
| 2451 | | ".tmp_source.zig:4:11: error: expected type 'usize', found 'bool'", |
| 2452 | | ".tmp_source.zig:4:24: error: expected type 'usize', found 'bool'", |
| 2496 | "tmp.zig:4:11: error: expected type 'usize', found 'bool'", |
| 2497 | "tmp.zig:4:24: error: expected type 'usize', found 'bool'", |
| 2453 | 2498 | ); |
| 2454 | 2499 | |
| 2455 | 2500 | cases.add( |
| ... | ... | @@ -2460,7 +2505,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2460 | 2505 | \\} |
| 2461 | 2506 | \\export fn entry() void { f(); } |
| 2462 | 2507 | , |
| 2463 | | ".tmp_source.zig:3:7: error: cannot assign to constant", |
| 2508 | "tmp.zig:3:7: error: cannot assign to constant", |
| 2464 | 2509 | ); |
| 2465 | 2510 | |
| 2466 | 2511 | cases.add( |
| ... | ... | @@ -2471,26 +2516,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2471 | 2516 | \\} |
| 2472 | 2517 | \\export fn entry() void { f(true); } |
| 2473 | 2518 | , |
| 2474 | | ".tmp_source.zig:2:42: error: integer value 1 cannot be implicitly casted to type 'void'", |
| 2475 | | ".tmp_source.zig:3:15: error: incompatible types: 'i32' and 'void'", |
| 2476 | | ); |
| 2477 | | |
| 2478 | | cases.add( |
| 2479 | | "direct struct loop", |
| 2480 | | \\const A = struct { a : A, }; |
| 2481 | | \\export fn entry() usize { return @sizeOf(A); } |
| 2482 | | , |
| 2483 | | ".tmp_source.zig:1:11: error: struct 'A' contains itself", |
| 2484 | | ); |
| 2485 | | |
| 2486 | | cases.add( |
| 2487 | | "indirect struct loop", |
| 2488 | | \\const A = struct { b : B, }; |
| 2489 | | \\const B = struct { c : C, }; |
| 2490 | | \\const C = struct { a : A, }; |
| 2491 | | \\export fn entry() usize { return @sizeOf(A); } |
| 2492 | | , |
| 2493 | | ".tmp_source.zig:1:11: error: struct 'A' contains itself", |
| 2519 | "tmp.zig:2:42: error: integer value 1 cannot be implicitly casted to type 'void'", |
| 2520 | "tmp.zig:3:15: error: incompatible types: 'i32' and 'void'", |
| 2494 | 2521 | ); |
| 2495 | 2522 | |
| 2496 | 2523 | cases.add( |
| ... | ... | @@ -2502,8 +2529,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2502 | 2529 | \\ const y = a.bar; |
| 2503 | 2530 | \\} |
| 2504 | 2531 | , |
| 2505 | | ".tmp_source.zig:4:6: error: no member named 'foo' in struct 'A'", |
| 2506 | | ".tmp_source.zig:5:16: error: no member named 'bar' in struct 'A'", |
| 2532 | "tmp.zig:4:6: error: no member named 'foo' in struct 'A'", |
| 2533 | "tmp.zig:5:16: error: no member named 'bar' in struct 'A'", |
| 2507 | 2534 | ); |
| 2508 | 2535 | |
| 2509 | 2536 | cases.add( |
| ... | ... | @@ -2511,7 +2538,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2511 | 2538 | \\const A = struct { x : i32, }; |
| 2512 | 2539 | \\const A = struct { y : i32, }; |
| 2513 | 2540 | , |
| 2514 | | ".tmp_source.zig:2:1: error: redefinition of 'A'", |
| 2541 | "tmp.zig:2:1: error: redefinition of 'A'", |
| 2515 | 2542 | ); |
| 2516 | 2543 | |
| 2517 | 2544 | cases.add( |
| ... | ... | @@ -2519,7 +2546,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2519 | 2546 | \\const A = enum {}; |
| 2520 | 2547 | \\const A = enum {}; |
| 2521 | 2548 | , |
| 2522 | | ".tmp_source.zig:2:1: error: redefinition of 'A'", |
| 2549 | "tmp.zig:2:1: error: redefinition of 'A'", |
| 2523 | 2550 | ); |
| 2524 | 2551 | |
| 2525 | 2552 | cases.add( |
| ... | ... | @@ -2527,8 +2554,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2527 | 2554 | \\var a : i32 = 1; |
| 2528 | 2555 | \\var a : i32 = 2; |
| 2529 | 2556 | , |
| 2530 | | ".tmp_source.zig:2:1: error: redefinition of 'a'", |
| 2531 | | ".tmp_source.zig:1:1: note: previous definition is here", |
| 2557 | "tmp.zig:2:1: error: redefinition of 'a'", |
| 2558 | "tmp.zig:1:1: note: previous definition is here", |
| 2532 | 2559 | ); |
| 2533 | 2560 | |
| 2534 | 2561 | cases.add( |
| ... | ... | @@ -2547,7 +2574,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2547 | 2574 | \\ }; |
| 2548 | 2575 | \\} |
| 2549 | 2576 | , |
| 2550 | | ".tmp_source.zig:11:9: error: duplicate field", |
| 2577 | "tmp.zig:11:9: error: duplicate field", |
| 2551 | 2578 | ); |
| 2552 | 2579 | |
| 2553 | 2580 | cases.add( |
| ... | ... | @@ -2566,7 +2593,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2566 | 2593 | \\ }; |
| 2567 | 2594 | \\} |
| 2568 | 2595 | , |
| 2569 | | ".tmp_source.zig:9:17: error: missing field: 'x'", |
| 2596 | "tmp.zig:9:17: error: missing field: 'x'", |
| 2570 | 2597 | ); |
| 2571 | 2598 | |
| 2572 | 2599 | cases.add( |
| ... | ... | @@ -2584,7 +2611,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2584 | 2611 | \\ }; |
| 2585 | 2612 | \\} |
| 2586 | 2613 | , |
| 2587 | | ".tmp_source.zig:10:9: error: no member named 'foo' in struct 'A'", |
| 2614 | "tmp.zig:10:9: error: no member named 'foo' in struct 'A'", |
| 2588 | 2615 | ); |
| 2589 | 2616 | |
| 2590 | 2617 | cases.add( |
| ... | ... | @@ -2593,7 +2620,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2593 | 2620 | \\ break; |
| 2594 | 2621 | \\} |
| 2595 | 2622 | , |
| 2596 | | ".tmp_source.zig:2:5: error: break expression outside loop", |
| 2623 | "tmp.zig:2:5: error: break expression outside loop", |
| 2597 | 2624 | ); |
| 2598 | 2625 | |
| 2599 | 2626 | cases.add( |
| ... | ... | @@ -2602,7 +2629,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2602 | 2629 | \\ continue; |
| 2603 | 2630 | \\} |
| 2604 | 2631 | , |
| 2605 | | ".tmp_source.zig:2:5: error: continue expression outside loop", |
| 2632 | "tmp.zig:2:5: error: continue expression outside loop", |
| 2606 | 2633 | ); |
| 2607 | 2634 | |
| 2608 | 2635 | cases.add( |
| ... | ... | @@ -2611,7 +2638,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2611 | 2638 | \\ if (true) |x| { } |
| 2612 | 2639 | \\} |
| 2613 | 2640 | , |
| 2614 | | ".tmp_source.zig:2:9: error: expected optional type, found 'bool'", |
| 2641 | "tmp.zig:2:9: error: expected optional type, found 'bool'", |
| 2615 | 2642 | ); |
| 2616 | 2643 | |
| 2617 | 2644 | cases.add( |
| ... | ... | @@ -2621,7 +2648,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2621 | 2648 | \\} |
| 2622 | 2649 | \\export fn entry() void { _ = f(); } |
| 2623 | 2650 | , |
| 2624 | | ".tmp_source.zig:2:15: error: unreachable code", |
| 2651 | "tmp.zig:2:15: error: unreachable code", |
| 2625 | 2652 | ); |
| 2626 | 2653 | |
| 2627 | 2654 | cases.add( |
| ... | ... | @@ -2630,7 +2657,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2630 | 2657 | \\} |
| 2631 | 2658 | \\export fn entry() void { _ = f(); } |
| 2632 | 2659 | , |
| 2633 | | ".tmp_source.zig:1:8: error: invalid builtin function: 'bogus'", |
| 2660 | "tmp.zig:1:8: error: invalid builtin function: 'bogus'", |
| 2634 | 2661 | ); |
| 2635 | 2662 | |
| 2636 | 2663 | cases.add( |
| ... | ... | @@ -2638,7 +2665,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2638 | 2665 | \\fn f(noalias x: i32) void {} |
| 2639 | 2666 | \\export fn entry() void { f(1234); } |
| 2640 | 2667 | , |
| 2641 | | ".tmp_source.zig:1:6: error: noalias on non-pointer parameter", |
| 2668 | "tmp.zig:1:6: error: noalias on non-pointer parameter", |
| 2642 | 2669 | ); |
| 2643 | 2670 | |
| 2644 | 2671 | cases.add( |
| ... | ... | @@ -2646,7 +2673,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2646 | 2673 | \\const foo = []u16{.x = 1024,}; |
| 2647 | 2674 | \\export fn entry() usize { return @sizeOf(@typeOf(foo)); } |
| 2648 | 2675 | , |
| 2649 | | ".tmp_source.zig:1:18: error: type '[]u16' does not support struct initialization syntax", |
| 2676 | "tmp.zig:1:18: error: type '[]u16' does not support struct initialization syntax", |
| 2650 | 2677 | ); |
| 2651 | 2678 | |
| 2652 | 2679 | cases.add( |
| ... | ... | @@ -2656,7 +2683,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2656 | 2683 | \\ return 1; |
| 2657 | 2684 | \\} |
| 2658 | 2685 | , |
| 2659 | | ".tmp_source.zig:1:1: error: variable of type 'type' must be constant", |
| 2686 | "tmp.zig:1:1: error: variable of type 'type' must be constant", |
| 2660 | 2687 | ); |
| 2661 | 2688 | |
| 2662 | 2689 | cases.add( |
| ... | ... | @@ -2672,10 +2699,10 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2672 | 2699 | \\ f(1234); |
| 2673 | 2700 | \\} |
| 2674 | 2701 | , |
| 2675 | | ".tmp_source.zig:4:6: error: redefinition of 'Foo'", |
| 2676 | | ".tmp_source.zig:1:1: note: previous definition is here", |
| 2677 | | ".tmp_source.zig:5:5: error: redefinition of 'Bar'", |
| 2678 | | ".tmp_source.zig:2:1: note: previous definition is here", |
| 2702 | "tmp.zig:4:6: error: redefinition of 'Foo'", |
| 2703 | "tmp.zig:1:1: note: previous definition is here", |
| 2704 | "tmp.zig:5:5: error: redefinition of 'Bar'", |
| 2705 | "tmp.zig:2:1: note: previous definition is here", |
| 2679 | 2706 | ); |
| 2680 | 2707 | |
| 2681 | 2708 | cases.add( |
| ... | ... | @@ -2696,7 +2723,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2696 | 2723 | \\ |
| 2697 | 2724 | \\export fn entry() usize { return @sizeOf(@typeOf(f)); } |
| 2698 | 2725 | , |
| 2699 | | ".tmp_source.zig:8:5: error: enumeration value 'Number.Four' not handled in switch", |
| 2726 | "tmp.zig:8:5: error: enumeration value 'Number.Four' not handled in switch", |
| 2700 | 2727 | ); |
| 2701 | 2728 | |
| 2702 | 2729 | cases.add( |
| ... | ... | @@ -2719,8 +2746,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2719 | 2746 | \\ |
| 2720 | 2747 | \\export fn entry() usize { return @sizeOf(@typeOf(f)); } |
| 2721 | 2748 | , |
| 2722 | | ".tmp_source.zig:13:15: error: duplicate switch value", |
| 2723 | | ".tmp_source.zig:10:15: note: other value is here", |
| 2749 | "tmp.zig:13:15: error: duplicate switch value", |
| 2750 | "tmp.zig:10:15: note: other value is here", |
| 2724 | 2751 | ); |
| 2725 | 2752 | |
| 2726 | 2753 | cases.add( |
| ... | ... | @@ -2744,8 +2771,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2744 | 2771 | \\ |
| 2745 | 2772 | \\export fn entry() usize { return @sizeOf(@typeOf(f)); } |
| 2746 | 2773 | , |
| 2747 | | ".tmp_source.zig:13:15: error: duplicate switch value", |
| 2748 | | ".tmp_source.zig:10:15: note: other value is here", |
| 2774 | "tmp.zig:13:15: error: duplicate switch value", |
| 2775 | "tmp.zig:10:15: note: other value is here", |
| 2749 | 2776 | ); |
| 2750 | 2777 | |
| 2751 | 2778 | cases.add( |
| ... | ... | @@ -2761,7 +2788,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2761 | 2788 | \\ f(1234); |
| 2762 | 2789 | \\} |
| 2763 | 2790 | , |
| 2764 | | ".tmp_source.zig:5:9: error: multiple else prongs in switch expression", |
| 2791 | "tmp.zig:5:9: error: multiple else prongs in switch expression", |
| 2765 | 2792 | ); |
| 2766 | 2793 | |
| 2767 | 2794 | cases.add( |
| ... | ... | @@ -2773,7 +2800,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2773 | 2800 | \\} |
| 2774 | 2801 | \\export fn entry() usize { return @sizeOf(@typeOf(foo)); } |
| 2775 | 2802 | , |
| 2776 | | ".tmp_source.zig:2:5: error: switch must handle all possibilities", |
| 2803 | "tmp.zig:2:5: error: switch must handle all possibilities", |
| 2777 | 2804 | ); |
| 2778 | 2805 | |
| 2779 | 2806 | cases.add( |
| ... | ... | @@ -2788,8 +2815,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2788 | 2815 | \\} |
| 2789 | 2816 | \\export fn entry() usize { return @sizeOf(@typeOf(foo)); } |
| 2790 | 2817 | , |
| 2791 | | ".tmp_source.zig:6:9: error: duplicate switch value", |
| 2792 | | ".tmp_source.zig:5:14: note: previous value is here", |
| 2818 | "tmp.zig:6:9: error: duplicate switch value", |
| 2819 | "tmp.zig:5:14: note: previous value is here", |
| 2793 | 2820 | ); |
| 2794 | 2821 | |
| 2795 | 2822 | cases.add( |
| ... | ... | @@ -2802,7 +2829,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2802 | 2829 | \\const y: u8 = 100; |
| 2803 | 2830 | \\export fn entry() usize { return @sizeOf(@typeOf(foo)); } |
| 2804 | 2831 | , |
| 2805 | | ".tmp_source.zig:2:5: error: else prong required when switching on type '*u8'", |
| 2832 | "tmp.zig:2:5: error: else prong required when switching on type '*u8'", |
| 2806 | 2833 | ); |
| 2807 | 2834 | |
| 2808 | 2835 | cases.add( |
| ... | ... | @@ -2811,7 +2838,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2811 | 2838 | \\const x = foo(); |
| 2812 | 2839 | \\export fn entry() i32 { return x; } |
| 2813 | 2840 | , |
| 2814 | | ".tmp_source.zig:2:11: error: unable to evaluate constant expression", |
| 2841 | "tmp.zig:2:11: error: unable to evaluate constant expression", |
| 2815 | 2842 | ); |
| 2816 | 2843 | |
| 2817 | 2844 | cases.add( |
| ... | ... | @@ -2822,7 +2849,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2822 | 2849 | \\ |
| 2823 | 2850 | \\export fn entry() usize { return @sizeOf(@typeOf(a)); } |
| 2824 | 2851 | , |
| 2825 | | ".tmp_source.zig:3:11: error: expected array or C string literal, found 'usize'", |
| 2852 | "tmp.zig:3:11: error: expected array or C string literal, found 'usize'", |
| 2826 | 2853 | ); |
| 2827 | 2854 | |
| 2828 | 2855 | cases.add( |
| ... | ... | @@ -2833,7 +2860,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2833 | 2860 | \\var s: [10]u8 = undefined; |
| 2834 | 2861 | \\export fn entry() usize { return @sizeOf(@typeOf(f)); } |
| 2835 | 2862 | , |
| 2836 | | ".tmp_source.zig:2:12: error: unable to evaluate constant expression", |
| 2863 | "tmp.zig:2:12: error: unable to evaluate constant expression", |
| 2837 | 2864 | ); |
| 2838 | 2865 | |
| 2839 | 2866 | cases.add( |
| ... | ... | @@ -2841,7 +2868,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2841 | 2868 | \\const c = @cImport(@cInclude("bogus.h")); |
| 2842 | 2869 | \\export fn entry() usize { return @sizeOf(@typeOf(c.bogo)); } |
| 2843 | 2870 | , |
| 2844 | | ".tmp_source.zig:1:11: error: C import failed", |
| 2871 | "tmp.zig:1:11: error: C import failed", |
| 2845 | 2872 | ".h:1:10: note: 'bogus.h' file not found", |
| 2846 | 2873 | ); |
| 2847 | 2874 | |
| ... | ... | @@ -2852,7 +2879,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2852 | 2879 | \\fn foo() *const i32 { return y; } |
| 2853 | 2880 | \\export fn entry() usize { return @sizeOf(@typeOf(foo)); } |
| 2854 | 2881 | , |
| 2855 | | ".tmp_source.zig:3:30: error: expected type '*const i32', found '*const comptime_int'", |
| 2882 | "tmp.zig:3:30: error: expected type '*const i32', found '*const comptime_int'", |
| 2856 | 2883 | ); |
| 2857 | 2884 | |
| 2858 | 2885 | cases.add( |
| ... | ... | @@ -2860,7 +2887,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2860 | 2887 | \\const x : u8 = 300; |
| 2861 | 2888 | \\export fn entry() usize { return @sizeOf(@typeOf(x)); } |
| 2862 | 2889 | , |
| 2863 | | ".tmp_source.zig:1:16: error: integer value 300 cannot be implicitly casted to type 'u8'", |
| 2890 | "tmp.zig:1:16: error: integer value 300 cannot be implicitly casted to type 'u8'", |
| 2864 | 2891 | ); |
| 2865 | 2892 | |
| 2866 | 2893 | cases.add( |
| ... | ... | @@ -2871,8 +2898,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2871 | 2898 | \\} |
| 2872 | 2899 | \\export fn entry() u16 { return f(); } |
| 2873 | 2900 | , |
| 2874 | | ".tmp_source.zig:3:14: error: RHS of shift is too large for LHS type", |
| 2875 | | ".tmp_source.zig:3:17: note: value 8 cannot fit into type u3", |
| 2901 | "tmp.zig:3:14: error: RHS of shift is too large for LHS type", |
| 2902 | "tmp.zig:3:17: note: value 8 cannot fit into type u3", |
| 2876 | 2903 | ); |
| 2877 | 2904 | |
| 2878 | 2905 | cases.add( |
| ... | ... | @@ -2880,7 +2907,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2880 | 2907 | \\const x = 2 == 2.0; |
| 2881 | 2908 | \\export fn entry() usize { return @sizeOf(@typeOf(x)); } |
| 2882 | 2909 | , |
| 2883 | | ".tmp_source.zig:1:11: error: integer value 2 cannot be implicitly casted to type 'comptime_float'", |
| 2910 | "tmp.zig:1:11: error: integer value 2 cannot be implicitly casted to type 'comptime_float'", |
| 2884 | 2911 | ); |
| 2885 | 2912 | |
| 2886 | 2913 | cases.add( |
| ... | ... | @@ -2909,7 +2936,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2909 | 2936 | \\ |
| 2910 | 2937 | \\export fn entry() usize { return @sizeOf(@typeOf(f)); } |
| 2911 | 2938 | , |
| 2912 | | ".tmp_source.zig:20:34: error: expected 1 arguments, found 0", |
| 2939 | "tmp.zig:20:34: error: expected 1 arguments, found 0", |
| 2913 | 2940 | ); |
| 2914 | 2941 | |
| 2915 | 2942 | cases.add( |
| ... | ... | @@ -2918,8 +2945,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2918 | 2945 | \\fn f(i32) void {} |
| 2919 | 2946 | \\export fn entry() usize { return @sizeOf(@typeOf(f)); } |
| 2920 | 2947 | , |
| 2921 | | ".tmp_source.zig:1:1: error: missing function name", |
| 2922 | | ".tmp_source.zig:2:6: error: missing parameter name", |
| 2948 | "tmp.zig:1:1: error: missing function name", |
| 2949 | "tmp.zig:2:6: error: missing parameter name", |
| 2923 | 2950 | ); |
| 2924 | 2951 | |
| 2925 | 2952 | cases.add( |
| ... | ... | @@ -2930,7 +2957,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2930 | 2957 | \\fn c() i32 {return 2;} |
| 2931 | 2958 | \\export fn entry() usize { return @sizeOf(@typeOf(fns)); } |
| 2932 | 2959 | , |
| 2933 | | ".tmp_source.zig:1:27: error: expected type 'fn() void', found 'fn() i32'", |
| 2960 | "tmp.zig:1:27: error: expected type 'fn() void', found 'fn() i32'", |
| 2934 | 2961 | ); |
| 2935 | 2962 | |
| 2936 | 2963 | cases.add( |
| ... | ... | @@ -2942,7 +2969,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2942 | 2969 | \\ |
| 2943 | 2970 | \\export fn entry() usize { return @sizeOf(@typeOf(fns)); } |
| 2944 | 2971 | , |
| 2945 | | ".tmp_source.zig:1:36: error: expected type 'fn(i32) i32', found 'extern fn(i32) i32'", |
| 2972 | "tmp.zig:1:36: error: expected type 'fn(i32) i32', found 'extern fn(i32) i32'", |
| 2946 | 2973 | ); |
| 2947 | 2974 | |
| 2948 | 2975 | cases.add( |
| ... | ... | @@ -2951,16 +2978,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2951 | 2978 | \\fn func() bogus {} |
| 2952 | 2979 | \\export fn entry() usize { return @sizeOf(@typeOf(func)); } |
| 2953 | 2980 | , |
| 2954 | | ".tmp_source.zig:2:1: error: redefinition of 'func'", |
| 2955 | | ".tmp_source.zig:1:11: error: use of undeclared identifier 'bogus'", |
| 2956 | | ); |
| 2957 | | |
| 2958 | | cases.add( |
| 2959 | | "bogus compile var", |
| 2960 | | \\const x = @import("builtin").bogus; |
| 2961 | | \\export fn entry() usize { return @sizeOf(@typeOf(x)); } |
| 2962 | | , |
| 2963 | | ".tmp_source.zig:1:29: error: no member named 'bogus' in '", |
| 2981 | "tmp.zig:2:1: error: redefinition of 'func'", |
| 2982 | "tmp.zig:1:11: error: use of undeclared identifier 'bogus'", |
| 2964 | 2983 | ); |
| 2965 | 2984 | |
| 2966 | 2985 | cases.add( |
| ... | ... | @@ -2973,9 +2992,9 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2973 | 2992 | \\ |
| 2974 | 2993 | \\export fn entry() usize { return @sizeOf(@typeOf(Foo)); } |
| 2975 | 2994 | , |
| 2976 | | ".tmp_source.zig:5:25: error: unable to evaluate constant expression", |
| 2977 | | ".tmp_source.zig:2:12: note: called from here", |
| 2978 | | ".tmp_source.zig:2:8: note: called from here", |
| 2995 | "tmp.zig:5:25: error: unable to evaluate constant expression", |
| 2996 | "tmp.zig:2:12: note: called from here", |
| 2997 | "tmp.zig:2:8: note: called from here", |
| 2979 | 2998 | ); |
| 2980 | 2999 | |
| 2981 | 3000 | cases.add( |
| ... | ... | @@ -2987,7 +3006,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2987 | 3006 | \\ |
| 2988 | 3007 | \\export fn entry() usize { return @sizeOf(@typeOf(x)); } |
| 2989 | 3008 | , |
| 2990 | | ".tmp_source.zig:4:28: error: invalid operands to binary expression: 'Foo' and 'Foo'", |
| 3009 | "tmp.zig:4:28: error: invalid operands to binary expression: 'Foo' and 'Foo'", |
| 2991 | 3010 | ); |
| 2992 | 3011 | |
| 2993 | 3012 | cases.add( |
| ... | ... | @@ -3002,10 +3021,10 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3002 | 3021 | \\export fn entry3() usize { return @sizeOf(@typeOf(int_x)); } |
| 3003 | 3022 | \\export fn entry4() usize { return @sizeOf(@typeOf(float_x)); } |
| 3004 | 3023 | , |
| 3005 | | ".tmp_source.zig:1:21: error: division by zero", |
| 3006 | | ".tmp_source.zig:2:25: error: division by zero", |
| 3007 | | ".tmp_source.zig:3:22: error: division by zero", |
| 3008 | | ".tmp_source.zig:4:26: error: division by zero", |
| 3024 | "tmp.zig:1:21: error: division by zero", |
| 3025 | "tmp.zig:2:25: error: division by zero", |
| 3026 | "tmp.zig:3:22: error: division by zero", |
| 3027 | "tmp.zig:4:26: error: division by zero", |
| 3009 | 3028 | ); |
| 3010 | 3029 | |
| 3011 | 3030 | cases.add( |
| ... | ... | @@ -3015,7 +3034,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3015 | 3034 | \\ |
| 3016 | 3035 | \\export fn entry() usize { return @sizeOf(@typeOf(foo)); } |
| 3017 | 3036 | , |
| 3018 | | ".tmp_source.zig:1:15: error: newline not allowed in string literal", |
| 3037 | "tmp.zig:1:15: error: newline not allowed in string literal", |
| 3019 | 3038 | ); |
| 3020 | 3039 | |
| 3021 | 3040 | cases.add( |
| ... | ... | @@ -3025,7 +3044,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3025 | 3044 | \\ |
| 3026 | 3045 | \\export fn entry() usize { return @sizeOf(@typeOf(invalid)); } |
| 3027 | 3046 | , |
| 3028 | | ".tmp_source.zig:2:21: error: operator not allowed for type 'fn() void'", |
| 3047 | "tmp.zig:2:21: error: operator not allowed for type 'fn() void'", |
| 3029 | 3048 | ); |
| 3030 | 3049 | |
| 3031 | 3050 | cases.add( |
| ... | ... | @@ -3037,7 +3056,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3037 | 3056 | \\ |
| 3038 | 3057 | \\export fn entry() usize { return @sizeOf(@typeOf(test1)); } |
| 3039 | 3058 | , |
| 3040 | | ".tmp_source.zig:3:16: error: unable to evaluate constant expression", |
| 3059 | "tmp.zig:3:16: error: unable to evaluate constant expression", |
| 3041 | 3060 | ); |
| 3042 | 3061 | |
| 3043 | 3062 | cases.add( |
| ... | ... | @@ -3046,7 +3065,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3046 | 3065 | \\ |
| 3047 | 3066 | \\export fn entry() usize { return @sizeOf(@typeOf(a)); } |
| 3048 | 3067 | , |
| 3049 | | ".tmp_source.zig:1:16: error: expected type '*u8', found '(null)'", |
| 3068 | "tmp.zig:1:16: error: expected type '*u8', found '(null)'", |
| 3050 | 3069 | ); |
| 3051 | 3070 | |
| 3052 | 3071 | cases.add( |
| ... | ... | @@ -3056,7 +3075,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3056 | 3075 | \\ const pointer = &array[0]; |
| 3057 | 3076 | \\} |
| 3058 | 3077 | , |
| 3059 | | ".tmp_source.zig:3:27: error: index 0 outside array of size 0", |
| 3078 | "tmp.zig:3:27: error: index 0 outside array of size 0", |
| 3060 | 3079 | ); |
| 3061 | 3080 | |
| 3062 | 3081 | cases.add( |
| ... | ... | @@ -3068,8 +3087,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3068 | 3087 | \\ |
| 3069 | 3088 | \\export fn entry() usize { return @sizeOf(@typeOf(y)); } |
| 3070 | 3089 | , |
| 3071 | | ".tmp_source.zig:3:14: error: division by zero", |
| 3072 | | ".tmp_source.zig:1:14: note: called from here", |
| 3090 | "tmp.zig:3:14: error: division by zero", |
| 3091 | "tmp.zig:1:14: note: called from here", |
| 3073 | 3092 | ); |
| 3074 | 3093 | |
| 3075 | 3094 | cases.add( |
| ... | ... | @@ -3078,7 +3097,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3078 | 3097 | \\ |
| 3079 | 3098 | \\export fn entry() usize { return @sizeOf(@typeOf(x)); } |
| 3080 | 3099 | , |
| 3081 | | ".tmp_source.zig:1:15: error: use of undefined value here causes undefined behavior", |
| 3100 | "tmp.zig:1:15: error: use of undefined value here causes undefined behavior", |
| 3082 | 3101 | ); |
| 3083 | 3102 | |
| 3084 | 3103 | cases.add( |
| ... | ... | @@ -3088,7 +3107,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3088 | 3107 | \\ _ = a / a; |
| 3089 | 3108 | \\} |
| 3090 | 3109 | , |
| 3091 | | ".tmp_source.zig:3:9: error: use of undefined value here causes undefined behavior", |
| 3110 | "tmp.zig:3:9: error: use of undefined value here causes undefined behavior", |
| 3092 | 3111 | ); |
| 3093 | 3112 | |
| 3094 | 3113 | cases.add( |
| ... | ... | @@ -3098,7 +3117,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3098 | 3117 | \\ a /= a; |
| 3099 | 3118 | \\} |
| 3100 | 3119 | , |
| 3101 | | ".tmp_source.zig:3:5: error: use of undefined value here causes undefined behavior", |
| 3120 | "tmp.zig:3:5: error: use of undefined value here causes undefined behavior", |
| 3102 | 3121 | ); |
| 3103 | 3122 | |
| 3104 | 3123 | cases.add( |
| ... | ... | @@ -3108,7 +3127,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3108 | 3127 | \\ _ = a % a; |
| 3109 | 3128 | \\} |
| 3110 | 3129 | , |
| 3111 | | ".tmp_source.zig:3:9: error: use of undefined value here causes undefined behavior", |
| 3130 | "tmp.zig:3:9: error: use of undefined value here causes undefined behavior", |
| 3112 | 3131 | ); |
| 3113 | 3132 | |
| 3114 | 3133 | cases.add( |
| ... | ... | @@ -3118,7 +3137,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3118 | 3137 | \\ a %= a; |
| 3119 | 3138 | \\} |
| 3120 | 3139 | , |
| 3121 | | ".tmp_source.zig:3:5: error: use of undefined value here causes undefined behavior", |
| 3140 | "tmp.zig:3:5: error: use of undefined value here causes undefined behavior", |
| 3122 | 3141 | ); |
| 3123 | 3142 | |
| 3124 | 3143 | cases.add( |
| ... | ... | @@ -3128,7 +3147,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3128 | 3147 | \\ _ = a + a; |
| 3129 | 3148 | \\} |
| 3130 | 3149 | , |
| 3131 | | ".tmp_source.zig:3:9: error: use of undefined value here causes undefined behavior", |
| 3150 | "tmp.zig:3:9: error: use of undefined value here causes undefined behavior", |
| 3132 | 3151 | ); |
| 3133 | 3152 | |
| 3134 | 3153 | cases.add( |
| ... | ... | @@ -3138,7 +3157,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3138 | 3157 | \\ a += a; |
| 3139 | 3158 | \\} |
| 3140 | 3159 | , |
| 3141 | | ".tmp_source.zig:3:5: error: use of undefined value here causes undefined behavior", |
| 3160 | "tmp.zig:3:5: error: use of undefined value here causes undefined behavior", |
| 3142 | 3161 | ); |
| 3143 | 3162 | |
| 3144 | 3163 | cases.add( |
| ... | ... | @@ -3148,7 +3167,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3148 | 3167 | \\ _ = a +% a; |
| 3149 | 3168 | \\} |
| 3150 | 3169 | , |
| 3151 | | ".tmp_source.zig:3:9: error: use of undefined value here causes undefined behavior", |
| 3170 | "tmp.zig:3:9: error: use of undefined value here causes undefined behavior", |
| 3152 | 3171 | ); |
| 3153 | 3172 | |
| 3154 | 3173 | cases.add( |
| ... | ... | @@ -3158,7 +3177,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3158 | 3177 | \\ a +%= a; |
| 3159 | 3178 | \\} |
| 3160 | 3179 | , |
| 3161 | | ".tmp_source.zig:3:5: error: use of undefined value here causes undefined behavior", |
| 3180 | "tmp.zig:3:5: error: use of undefined value here causes undefined behavior", |
| 3162 | 3181 | ); |
| 3163 | 3182 | |
| 3164 | 3183 | cases.add( |
| ... | ... | @@ -3168,7 +3187,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3168 | 3187 | \\ _ = a - a; |
| 3169 | 3188 | \\} |
| 3170 | 3189 | , |
| 3171 | | ".tmp_source.zig:3:9: error: use of undefined value here causes undefined behavior", |
| 3190 | "tmp.zig:3:9: error: use of undefined value here causes undefined behavior", |
| 3172 | 3191 | ); |
| 3173 | 3192 | |
| 3174 | 3193 | cases.add( |
| ... | ... | @@ -3178,7 +3197,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3178 | 3197 | \\ a -= a; |
| 3179 | 3198 | \\} |
| 3180 | 3199 | , |
| 3181 | | ".tmp_source.zig:3:5: error: use of undefined value here causes undefined behavior", |
| 3200 | "tmp.zig:3:5: error: use of undefined value here causes undefined behavior", |
| 3182 | 3201 | ); |
| 3183 | 3202 | |
| 3184 | 3203 | cases.add( |
| ... | ... | @@ -3188,7 +3207,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3188 | 3207 | \\ _ = a -% a; |
| 3189 | 3208 | \\} |
| 3190 | 3209 | , |
| 3191 | | ".tmp_source.zig:3:9: error: use of undefined value here causes undefined behavior", |
| 3210 | "tmp.zig:3:9: error: use of undefined value here causes undefined behavior", |
| 3192 | 3211 | ); |
| 3193 | 3212 | |
| 3194 | 3213 | cases.add( |
| ... | ... | @@ -3198,7 +3217,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3198 | 3217 | \\ a -%= a; |
| 3199 | 3218 | \\} |
| 3200 | 3219 | , |
| 3201 | | ".tmp_source.zig:3:5: error: use of undefined value here causes undefined behavior", |
| 3220 | "tmp.zig:3:5: error: use of undefined value here causes undefined behavior", |
| 3202 | 3221 | ); |
| 3203 | 3222 | |
| 3204 | 3223 | cases.add( |
| ... | ... | @@ -3208,7 +3227,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3208 | 3227 | \\ _ = a * a; |
| 3209 | 3228 | \\} |
| 3210 | 3229 | , |
| 3211 | | ".tmp_source.zig:3:9: error: use of undefined value here causes undefined behavior", |
| 3230 | "tmp.zig:3:9: error: use of undefined value here causes undefined behavior", |
| 3212 | 3231 | ); |
| 3213 | 3232 | |
| 3214 | 3233 | cases.add( |
| ... | ... | @@ -3218,7 +3237,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3218 | 3237 | \\ a *= a; |
| 3219 | 3238 | \\} |
| 3220 | 3239 | , |
| 3221 | | ".tmp_source.zig:3:5: error: use of undefined value here causes undefined behavior", |
| 3240 | "tmp.zig:3:5: error: use of undefined value here causes undefined behavior", |
| 3222 | 3241 | ); |
| 3223 | 3242 | |
| 3224 | 3243 | cases.add( |
| ... | ... | @@ -3228,7 +3247,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3228 | 3247 | \\ _ = a *% a; |
| 3229 | 3248 | \\} |
| 3230 | 3249 | , |
| 3231 | | ".tmp_source.zig:3:9: error: use of undefined value here causes undefined behavior", |
| 3250 | "tmp.zig:3:9: error: use of undefined value here causes undefined behavior", |
| 3232 | 3251 | ); |
| 3233 | 3252 | |
| 3234 | 3253 | cases.add( |
| ... | ... | @@ -3238,7 +3257,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3238 | 3257 | \\ a *%= a; |
| 3239 | 3258 | \\} |
| 3240 | 3259 | , |
| 3241 | | ".tmp_source.zig:3:5: error: use of undefined value here causes undefined behavior", |
| 3260 | "tmp.zig:3:5: error: use of undefined value here causes undefined behavior", |
| 3242 | 3261 | ); |
| 3243 | 3262 | |
| 3244 | 3263 | cases.add( |
| ... | ... | @@ -3248,7 +3267,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3248 | 3267 | \\ _ = a << 2; |
| 3249 | 3268 | \\} |
| 3250 | 3269 | , |
| 3251 | | ".tmp_source.zig:3:9: error: use of undefined value here causes undefined behavior", |
| 3270 | "tmp.zig:3:9: error: use of undefined value here causes undefined behavior", |
| 3252 | 3271 | ); |
| 3253 | 3272 | |
| 3254 | 3273 | cases.add( |
| ... | ... | @@ -3258,7 +3277,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3258 | 3277 | \\ a <<= 2; |
| 3259 | 3278 | \\} |
| 3260 | 3279 | , |
| 3261 | | ".tmp_source.zig:3:5: error: use of undefined value here causes undefined behavior", |
| 3280 | "tmp.zig:3:5: error: use of undefined value here causes undefined behavior", |
| 3262 | 3281 | ); |
| 3263 | 3282 | |
| 3264 | 3283 | cases.add( |
| ... | ... | @@ -3268,7 +3287,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3268 | 3287 | \\ _ = a >> 2; |
| 3269 | 3288 | \\} |
| 3270 | 3289 | , |
| 3271 | | ".tmp_source.zig:3:9: error: use of undefined value here causes undefined behavior", |
| 3290 | "tmp.zig:3:9: error: use of undefined value here causes undefined behavior", |
| 3272 | 3291 | ); |
| 3273 | 3292 | |
| 3274 | 3293 | cases.add( |
| ... | ... | @@ -3278,7 +3297,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3278 | 3297 | \\ a >>= 2; |
| 3279 | 3298 | \\} |
| 3280 | 3299 | , |
| 3281 | | ".tmp_source.zig:3:5: error: use of undefined value here causes undefined behavior", |
| 3300 | "tmp.zig:3:5: error: use of undefined value here causes undefined behavior", |
| 3282 | 3301 | ); |
| 3283 | 3302 | |
| 3284 | 3303 | cases.add( |
| ... | ... | @@ -3288,7 +3307,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3288 | 3307 | \\ _ = a & a; |
| 3289 | 3308 | \\} |
| 3290 | 3309 | , |
| 3291 | | ".tmp_source.zig:3:9: error: use of undefined value here causes undefined behavior", |
| 3310 | "tmp.zig:3:9: error: use of undefined value here causes undefined behavior", |
| 3292 | 3311 | ); |
| 3293 | 3312 | |
| 3294 | 3313 | cases.add( |
| ... | ... | @@ -3298,7 +3317,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3298 | 3317 | \\ a &= a; |
| 3299 | 3318 | \\} |
| 3300 | 3319 | , |
| 3301 | | ".tmp_source.zig:3:5: error: use of undefined value here causes undefined behavior", |
| 3320 | "tmp.zig:3:5: error: use of undefined value here causes undefined behavior", |
| 3302 | 3321 | ); |
| 3303 | 3322 | |
| 3304 | 3323 | cases.add( |
| ... | ... | @@ -3308,7 +3327,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3308 | 3327 | \\ _ = a | a; |
| 3309 | 3328 | \\} |
| 3310 | 3329 | , |
| 3311 | | ".tmp_source.zig:3:9: error: use of undefined value here causes undefined behavior", |
| 3330 | "tmp.zig:3:9: error: use of undefined value here causes undefined behavior", |
| 3312 | 3331 | ); |
| 3313 | 3332 | |
| 3314 | 3333 | cases.add( |
| ... | ... | @@ -3318,7 +3337,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3318 | 3337 | \\ a |= a; |
| 3319 | 3338 | \\} |
| 3320 | 3339 | , |
| 3321 | | ".tmp_source.zig:3:5: error: use of undefined value here causes undefined behavior", |
| 3340 | "tmp.zig:3:5: error: use of undefined value here causes undefined behavior", |
| 3322 | 3341 | ); |
| 3323 | 3342 | |
| 3324 | 3343 | cases.add( |
| ... | ... | @@ -3328,7 +3347,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3328 | 3347 | \\ _ = a ^ a; |
| 3329 | 3348 | \\} |
| 3330 | 3349 | , |
| 3331 | | ".tmp_source.zig:3:9: error: use of undefined value here causes undefined behavior", |
| 3350 | "tmp.zig:3:9: error: use of undefined value here causes undefined behavior", |
| 3332 | 3351 | ); |
| 3333 | 3352 | |
| 3334 | 3353 | cases.add( |
| ... | ... | @@ -3338,7 +3357,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3338 | 3357 | \\ a ^= a; |
| 3339 | 3358 | \\} |
| 3340 | 3359 | , |
| 3341 | | ".tmp_source.zig:3:5: error: use of undefined value here causes undefined behavior", |
| 3360 | "tmp.zig:3:5: error: use of undefined value here causes undefined behavior", |
| 3342 | 3361 | ); |
| 3343 | 3362 | |
| 3344 | 3363 | cases.add( |
| ... | ... | @@ -3348,7 +3367,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3348 | 3367 | \\ _ = a == a; |
| 3349 | 3368 | \\} |
| 3350 | 3369 | , |
| 3351 | | ".tmp_source.zig:3:9: error: use of undefined value here causes undefined behavior", |
| 3370 | "tmp.zig:3:9: error: use of undefined value here causes undefined behavior", |
| 3352 | 3371 | ); |
| 3353 | 3372 | |
| 3354 | 3373 | cases.add( |
| ... | ... | @@ -3358,7 +3377,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3358 | 3377 | \\ _ = a != a; |
| 3359 | 3378 | \\} |
| 3360 | 3379 | , |
| 3361 | | ".tmp_source.zig:3:9: error: use of undefined value here causes undefined behavior", |
| 3380 | "tmp.zig:3:9: error: use of undefined value here causes undefined behavior", |
| 3362 | 3381 | ); |
| 3363 | 3382 | |
| 3364 | 3383 | cases.add( |
| ... | ... | @@ -3368,7 +3387,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3368 | 3387 | \\ _ = a > a; |
| 3369 | 3388 | \\} |
| 3370 | 3389 | , |
| 3371 | | ".tmp_source.zig:3:9: error: use of undefined value here causes undefined behavior", |
| 3390 | "tmp.zig:3:9: error: use of undefined value here causes undefined behavior", |
| 3372 | 3391 | ); |
| 3373 | 3392 | |
| 3374 | 3393 | cases.add( |
| ... | ... | @@ -3378,7 +3397,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3378 | 3397 | \\ _ = a >= a; |
| 3379 | 3398 | \\} |
| 3380 | 3399 | , |
| 3381 | | ".tmp_source.zig:3:9: error: use of undefined value here causes undefined behavior", |
| 3400 | "tmp.zig:3:9: error: use of undefined value here causes undefined behavior", |
| 3382 | 3401 | ); |
| 3383 | 3402 | |
| 3384 | 3403 | cases.add( |
| ... | ... | @@ -3388,7 +3407,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3388 | 3407 | \\ _ = a < a; |
| 3389 | 3408 | \\} |
| 3390 | 3409 | , |
| 3391 | | ".tmp_source.zig:3:9: error: use of undefined value here causes undefined behavior", |
| 3410 | "tmp.zig:3:9: error: use of undefined value here causes undefined behavior", |
| 3392 | 3411 | ); |
| 3393 | 3412 | |
| 3394 | 3413 | cases.add( |
| ... | ... | @@ -3398,7 +3417,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3398 | 3417 | \\ _ = a <= a; |
| 3399 | 3418 | \\} |
| 3400 | 3419 | , |
| 3401 | | ".tmp_source.zig:3:9: error: use of undefined value here causes undefined behavior", |
| 3420 | "tmp.zig:3:9: error: use of undefined value here causes undefined behavior", |
| 3402 | 3421 | ); |
| 3403 | 3422 | |
| 3404 | 3423 | cases.add( |
| ... | ... | @@ -3408,7 +3427,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3408 | 3427 | \\ _ = a and a; |
| 3409 | 3428 | \\} |
| 3410 | 3429 | , |
| 3411 | | ".tmp_source.zig:3:9: error: use of undefined value here causes undefined behavior", |
| 3430 | "tmp.zig:3:9: error: use of undefined value here causes undefined behavior", |
| 3412 | 3431 | ); |
| 3413 | 3432 | |
| 3414 | 3433 | cases.add( |
| ... | ... | @@ -3418,7 +3437,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3418 | 3437 | \\ _ = a or a; |
| 3419 | 3438 | \\} |
| 3420 | 3439 | , |
| 3421 | | ".tmp_source.zig:3:9: error: use of undefined value here causes undefined behavior", |
| 3440 | "tmp.zig:3:9: error: use of undefined value here causes undefined behavior", |
| 3422 | 3441 | ); |
| 3423 | 3442 | |
| 3424 | 3443 | cases.add( |
| ... | ... | @@ -3428,7 +3447,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3428 | 3447 | \\ _ = -a; |
| 3429 | 3448 | \\} |
| 3430 | 3449 | , |
| 3431 | | ".tmp_source.zig:3:10: error: use of undefined value here causes undefined behavior", |
| 3450 | "tmp.zig:3:10: error: use of undefined value here causes undefined behavior", |
| 3432 | 3451 | ); |
| 3433 | 3452 | |
| 3434 | 3453 | cases.add( |
| ... | ... | @@ -3438,7 +3457,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3438 | 3457 | \\ _ = -%a; |
| 3439 | 3458 | \\} |
| 3440 | 3459 | , |
| 3441 | | ".tmp_source.zig:3:11: error: use of undefined value here causes undefined behavior", |
| 3460 | "tmp.zig:3:11: error: use of undefined value here causes undefined behavior", |
| 3442 | 3461 | ); |
| 3443 | 3462 | |
| 3444 | 3463 | cases.add( |
| ... | ... | @@ -3448,7 +3467,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3448 | 3467 | \\ _ = ~a; |
| 3449 | 3468 | \\} |
| 3450 | 3469 | , |
| 3451 | | ".tmp_source.zig:3:10: error: use of undefined value here causes undefined behavior", |
| 3470 | "tmp.zig:3:10: error: use of undefined value here causes undefined behavior", |
| 3452 | 3471 | ); |
| 3453 | 3472 | |
| 3454 | 3473 | cases.add( |
| ... | ... | @@ -3458,7 +3477,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3458 | 3477 | \\ _ = !a; |
| 3459 | 3478 | \\} |
| 3460 | 3479 | , |
| 3461 | | ".tmp_source.zig:3:10: error: use of undefined value here causes undefined behavior", |
| 3480 | "tmp.zig:3:10: error: use of undefined value here causes undefined behavior", |
| 3462 | 3481 | ); |
| 3463 | 3482 | |
| 3464 | 3483 | cases.add( |
| ... | ... | @@ -3468,7 +3487,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3468 | 3487 | \\ _ = a orelse false; |
| 3469 | 3488 | \\} |
| 3470 | 3489 | , |
| 3471 | | ".tmp_source.zig:3:11: error: use of undefined value here causes undefined behavior", |
| 3490 | "tmp.zig:3:11: error: use of undefined value here causes undefined behavior", |
| 3472 | 3491 | ); |
| 3473 | 3492 | |
| 3474 | 3493 | cases.add( |
| ... | ... | @@ -3478,7 +3497,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3478 | 3497 | \\ _ = a catch |err| false; |
| 3479 | 3498 | \\} |
| 3480 | 3499 | , |
| 3481 | | ".tmp_source.zig:3:11: error: use of undefined value here causes undefined behavior", |
| 3500 | "tmp.zig:3:11: error: use of undefined value here causes undefined behavior", |
| 3482 | 3501 | ); |
| 3483 | 3502 | |
| 3484 | 3503 | cases.add( |
| ... | ... | @@ -3488,7 +3507,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3488 | 3507 | \\ _ = a.*; |
| 3489 | 3508 | \\} |
| 3490 | 3509 | , |
| 3491 | | ".tmp_source.zig:3:9: error: attempt to dereference undefined value", |
| 3510 | "tmp.zig:3:9: error: attempt to dereference undefined value", |
| 3492 | 3511 | ); |
| 3493 | 3512 | |
| 3494 | 3513 | cases.add( |
| ... | ... | @@ -3500,8 +3519,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3500 | 3519 | \\ |
| 3501 | 3520 | \\export fn entry() usize { return @sizeOf(@typeOf(seventh_fib_number)); } |
| 3502 | 3521 | , |
| 3503 | | ".tmp_source.zig:3:21: error: evaluation exceeded 1000 backwards branches", |
| 3504 | | ".tmp_source.zig:3:21: note: called from here", |
| 3522 | "tmp.zig:3:21: error: evaluation exceeded 1000 backwards branches", |
| 3523 | "tmp.zig:3:21: note: called from here", |
| 3505 | 3524 | ); |
| 3506 | 3525 | |
| 3507 | 3526 | cases.add( |
| ... | ... | @@ -3510,7 +3529,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3510 | 3529 | \\ |
| 3511 | 3530 | \\export fn entry() usize { return @sizeOf(@typeOf(resource)); } |
| 3512 | 3531 | , |
| 3513 | | ".tmp_source.zig:1:29: error: unable to find '", |
| 3532 | "tmp.zig:1:29: error: unable to find '", |
| 3514 | 3533 | "bogus.txt'", |
| 3515 | 3534 | ); |
| 3516 | 3535 | |
| ... | ... | @@ -3524,7 +3543,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3524 | 3543 | \\ |
| 3525 | 3544 | \\export fn entry() usize { return @sizeOf(@typeOf(a)); } |
| 3526 | 3545 | , |
| 3527 | | ".tmp_source.zig:4:21: error: unable to evaluate constant expression", |
| 3546 | "tmp.zig:4:21: error: unable to evaluate constant expression", |
| 3528 | 3547 | ); |
| 3529 | 3548 | |
| 3530 | 3549 | cases.add( |
| ... | ... | @@ -3541,8 +3560,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3541 | 3560 | \\ |
| 3542 | 3561 | \\export fn entry() usize { return @sizeOf(@typeOf(a)); } |
| 3543 | 3562 | , |
| 3544 | | ".tmp_source.zig:6:24: error: unable to evaluate constant expression", |
| 3545 | | ".tmp_source.zig:4:17: note: called from here", |
| 3563 | "tmp.zig:6:24: error: unable to evaluate constant expression", |
| 3564 | "tmp.zig:4:17: note: called from here", |
| 3546 | 3565 | ); |
| 3547 | 3566 | |
| 3548 | 3567 | cases.add( |
| ... | ... | @@ -3554,7 +3573,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3554 | 3573 | \\ bad_fn_call(); |
| 3555 | 3574 | \\} |
| 3556 | 3575 | , |
| 3557 | | ".tmp_source.zig:5:5: error: use of undeclared identifier 'bad_fn_call'", |
| 3576 | "tmp.zig:5:5: error: use of undeclared identifier 'bad_fn_call'", |
| 3558 | 3577 | ); |
| 3559 | 3578 | |
| 3560 | 3579 | cases.add( |
| ... | ... | @@ -3573,8 +3592,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3573 | 3592 | \\export fn entry1() usize { return @sizeOf(@typeOf(bad_eql_1)); } |
| 3574 | 3593 | \\export fn entry2() usize { return @sizeOf(@typeOf(bad_eql_2)); } |
| 3575 | 3594 | , |
| 3576 | | ".tmp_source.zig:2:14: error: operator not allowed for type '[]u8'", |
| 3577 | | ".tmp_source.zig:9:16: error: operator not allowed for type 'EnumWithData'", |
| 3595 | "tmp.zig:2:14: error: operator not allowed for type '[]u8'", |
| 3596 | "tmp.zig:9:16: error: operator not allowed for type 'EnumWithData'", |
| 3578 | 3597 | ); |
| 3579 | 3598 | |
| 3580 | 3599 | cases.add( |
| ... | ... | @@ -3590,7 +3609,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3590 | 3609 | \\ return 2; |
| 3591 | 3610 | \\} |
| 3592 | 3611 | , |
| 3593 | | ".tmp_source.zig:2:15: error: values of type 'comptime_int' must be comptime known", |
| 3612 | "tmp.zig:2:15: error: values of type 'comptime_int' must be comptime known", |
| 3594 | 3613 | ); |
| 3595 | 3614 | |
| 3596 | 3615 | cases.add( |
| ... | ... | @@ -3601,7 +3620,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3601 | 3620 | \\ while (!@cmpxchgWeak(i32, &x, 1234, 5678, AtomicOrder.Monotonic, AtomicOrder.SeqCst)) {} |
| 3602 | 3621 | \\} |
| 3603 | 3622 | , |
| 3604 | | ".tmp_source.zig:4:81: error: failure atomic ordering must be no stricter than success", |
| 3623 | "tmp.zig:4:81: error: failure atomic ordering must be no stricter than success", |
| 3605 | 3624 | ); |
| 3606 | 3625 | |
| 3607 | 3626 | cases.add( |
| ... | ... | @@ -3612,7 +3631,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3612 | 3631 | \\ while (!@cmpxchgWeak(i32, &x, 1234, 5678, AtomicOrder.Unordered, AtomicOrder.Unordered)) {} |
| 3613 | 3632 | \\} |
| 3614 | 3633 | , |
| 3615 | | ".tmp_source.zig:4:58: error: success atomic ordering must be Monotonic or stricter", |
| 3634 | "tmp.zig:4:58: error: success atomic ordering must be Monotonic or stricter", |
| 3616 | 3635 | ); |
| 3617 | 3636 | |
| 3618 | 3637 | cases.add( |
| ... | ... | @@ -3624,8 +3643,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3624 | 3643 | \\ |
| 3625 | 3644 | \\export fn entry() usize { return @sizeOf(@typeOf(y)); } |
| 3626 | 3645 | , |
| 3627 | | ".tmp_source.zig:3:12: error: negation caused overflow", |
| 3628 | | ".tmp_source.zig:1:14: note: called from here", |
| 3646 | "tmp.zig:3:12: error: negation caused overflow", |
| 3647 | "tmp.zig:1:14: note: called from here", |
| 3629 | 3648 | ); |
| 3630 | 3649 | |
| 3631 | 3650 | cases.add( |
| ... | ... | @@ -3637,8 +3656,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3637 | 3656 | \\ |
| 3638 | 3657 | \\export fn entry() usize { return @sizeOf(@typeOf(y)); } |
| 3639 | 3658 | , |
| 3640 | | ".tmp_source.zig:3:14: error: operation caused overflow", |
| 3641 | | ".tmp_source.zig:1:14: note: called from here", |
| 3659 | "tmp.zig:3:14: error: operation caused overflow", |
| 3660 | "tmp.zig:1:14: note: called from here", |
| 3642 | 3661 | ); |
| 3643 | 3662 | |
| 3644 | 3663 | cases.add( |
| ... | ... | @@ -3650,8 +3669,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3650 | 3669 | \\ |
| 3651 | 3670 | \\export fn entry() usize { return @sizeOf(@typeOf(y)); } |
| 3652 | 3671 | , |
| 3653 | | ".tmp_source.zig:3:14: error: operation caused overflow", |
| 3654 | | ".tmp_source.zig:1:14: note: called from here", |
| 3672 | "tmp.zig:3:14: error: operation caused overflow", |
| 3673 | "tmp.zig:1:14: note: called from here", |
| 3655 | 3674 | ); |
| 3656 | 3675 | |
| 3657 | 3676 | cases.add( |
| ... | ... | @@ -3663,8 +3682,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3663 | 3682 | \\ |
| 3664 | 3683 | \\export fn entry() usize { return @sizeOf(@typeOf(y)); } |
| 3665 | 3684 | , |
| 3666 | | ".tmp_source.zig:3:14: error: operation caused overflow", |
| 3667 | | ".tmp_source.zig:1:14: note: called from here", |
| 3685 | "tmp.zig:3:14: error: operation caused overflow", |
| 3686 | "tmp.zig:1:14: note: called from here", |
| 3668 | 3687 | ); |
| 3669 | 3688 | |
| 3670 | 3689 | cases.add( |
| ... | ... | @@ -3676,7 +3695,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3676 | 3695 | \\ |
| 3677 | 3696 | \\export fn entry() usize { return @sizeOf(@typeOf(f)); } |
| 3678 | 3697 | , |
| 3679 | | ".tmp_source.zig:3:26: error: expected signed integer type, found 'u32'", |
| 3698 | "tmp.zig:3:26: error: expected signed integer type, found 'u32'", |
| 3680 | 3699 | ); |
| 3681 | 3700 | |
| 3682 | 3701 | cases.add( |
| ... | ... | @@ -3686,8 +3705,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3686 | 3705 | \\} |
| 3687 | 3706 | \\fn something() anyerror!void { } |
| 3688 | 3707 | , |
| 3689 | | ".tmp_source.zig:2:5: error: expected type 'void', found 'anyerror'", |
| 3690 | | ".tmp_source.zig:1:15: note: return type declared here", |
| 3708 | "tmp.zig:2:5: error: expected type 'void', found 'anyerror'", |
| 3709 | "tmp.zig:1:15: note: return type declared here", |
| 3691 | 3710 | ); |
| 3692 | 3711 | |
| 3693 | 3712 | cases.add( |
| ... | ... | @@ -3700,7 +3719,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3700 | 3719 | \\ } |
| 3701 | 3720 | \\} |
| 3702 | 3721 | , |
| 3703 | | ".tmp_source.zig:2:13: error: unable to evaluate constant expression", |
| 3722 | "tmp.zig:2:13: error: unable to evaluate constant expression", |
| 3704 | 3723 | ); |
| 3705 | 3724 | |
| 3706 | 3725 | cases.add( |
| ... | ... | @@ -3709,7 +3728,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3709 | 3728 | \\ return x + y; |
| 3710 | 3729 | \\} |
| 3711 | 3730 | , |
| 3712 | | ".tmp_source.zig:1:15: error: comptime parameter not allowed in function with calling convention 'ccc'", |
| 3731 | "tmp.zig:1:15: error: comptime parameter not allowed in function with calling convention 'ccc'", |
| 3713 | 3732 | ); |
| 3714 | 3733 | |
| 3715 | 3734 | cases.add( |
| ... | ... | @@ -3720,7 +3739,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3720 | 3739 | \\} |
| 3721 | 3740 | \\export fn entry() usize { return @sizeOf(@typeOf(f)); } |
| 3722 | 3741 | , |
| 3723 | | ".tmp_source.zig:1:15: error: comptime parameter not allowed in function with calling convention 'ccc'", |
| 3742 | "tmp.zig:1:15: error: comptime parameter not allowed in function with calling convention 'ccc'", |
| 3724 | 3743 | ); |
| 3725 | 3744 | |
| 3726 | 3745 | cases.add( |
| ... | ... | @@ -3730,8 +3749,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3730 | 3749 | \\ var foo = @bytesToSlice(u32, array)[0]; |
| 3731 | 3750 | \\} |
| 3732 | 3751 | , |
| 3733 | | ".tmp_source.zig:3:15: error: unable to convert [5]u8 to []align(1) const u32: size mismatch", |
| 3734 | | ".tmp_source.zig:3:29: note: u32 has size 4; remaining bytes: 1", |
| 3752 | "tmp.zig:3:15: error: unable to convert [5]u8 to []align(1) const u32: size mismatch", |
| 3753 | "tmp.zig:3:29: note: u32 has size 4; remaining bytes: 1", |
| 3735 | 3754 | ); |
| 3736 | 3755 | |
| 3737 | 3756 | cases.add( |
| ... | ... | @@ -3755,8 +3774,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3755 | 3774 | \\ list.length = 10; |
| 3756 | 3775 | \\} |
| 3757 | 3776 | , |
| 3758 | | ".tmp_source.zig:3:7: error: unable to evaluate constant expression", |
| 3759 | | ".tmp_source.zig:16:19: note: called from here", |
| 3777 | "tmp.zig:3:7: error: unable to evaluate constant expression", |
| 3778 | "tmp.zig:16:19: note: called from here", |
| 3760 | 3779 | ); |
| 3761 | 3780 | |
| 3762 | 3781 | cases.add( |
| ... | ... | @@ -3767,7 +3786,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3767 | 3786 | \\} |
| 3768 | 3787 | \\export fn entry() usize { return @sizeOf(@typeOf(f)); } |
| 3769 | 3788 | , |
| 3770 | | ".tmp_source.zig:3:6: error: no member named 'copy' in '[]const u8'", |
| 3789 | "tmp.zig:3:6: error: no member named 'copy' in '[]const u8'", |
| 3771 | 3790 | ); |
| 3772 | 3791 | |
| 3773 | 3792 | cases.add( |
| ... | ... | @@ -3781,7 +3800,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3781 | 3800 | \\} |
| 3782 | 3801 | \\export fn entry() usize { return @sizeOf(@typeOf(f)); } |
| 3783 | 3802 | , |
| 3784 | | ".tmp_source.zig:6:15: error: expected 2 arguments, found 3", |
| 3803 | "tmp.zig:6:15: error: expected 2 arguments, found 3", |
| 3785 | 3804 | ); |
| 3786 | 3805 | |
| 3787 | 3806 | cases.add( |
| ... | ... | @@ -3791,7 +3810,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3791 | 3810 | \\ cstr[0] = 'W'; |
| 3792 | 3811 | \\} |
| 3793 | 3812 | , |
| 3794 | | ".tmp_source.zig:3:11: error: cannot assign to constant", |
| 3813 | "tmp.zig:3:11: error: cannot assign to constant", |
| 3795 | 3814 | ); |
| 3796 | 3815 | |
| 3797 | 3816 | cases.add( |
| ... | ... | @@ -3801,14 +3820,14 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3801 | 3820 | \\ cstr[0] = 'W'; |
| 3802 | 3821 | \\} |
| 3803 | 3822 | , |
| 3804 | | ".tmp_source.zig:3:11: error: cannot assign to constant", |
| 3823 | "tmp.zig:3:11: error: cannot assign to constant", |
| 3805 | 3824 | ); |
| 3806 | 3825 | |
| 3807 | 3826 | cases.add( |
| 3808 | 3827 | "main function with bogus args type", |
| 3809 | 3828 | \\pub fn main(args: [][]bogus) !void {} |
| 3810 | 3829 | , |
| 3811 | | ".tmp_source.zig:1:23: error: use of undeclared identifier 'bogus'", |
| 3830 | "tmp.zig:1:23: error: use of undeclared identifier 'bogus'", |
| 3812 | 3831 | ); |
| 3813 | 3832 | |
| 3814 | 3833 | cases.add( |
| ... | ... | @@ -3844,7 +3863,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3844 | 3863 | \\ |
| 3845 | 3864 | \\export fn entry() usize { return @sizeOf(@typeOf(foo)); } |
| 3846 | 3865 | , |
| 3847 | | ".tmp_source.zig:5:16: error: use of undeclared identifier 'JsonList'", |
| 3866 | "tmp.zig:5:16: error: use of undeclared identifier 'JsonList'", |
| 3848 | 3867 | ); |
| 3849 | 3868 | |
| 3850 | 3869 | cases.add( |
| ... | ... | @@ -3865,7 +3884,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3865 | 3884 | \\ derp.init(); |
| 3866 | 3885 | \\} |
| 3867 | 3886 | , |
| 3868 | | ".tmp_source.zig:14:5: error: expected type 'i32', found 'Foo'", |
| 3887 | "tmp.zig:14:5: error: expected type 'i32', found 'Foo'", |
| 3869 | 3888 | ); |
| 3870 | 3889 | |
| 3871 | 3890 | cases.add( |
| ... | ... | @@ -3895,7 +3914,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3895 | 3914 | \\ x.init(); |
| 3896 | 3915 | \\} |
| 3897 | 3916 | , |
| 3898 | | ".tmp_source.zig:23:5: error: expected type '*Allocator', found '*List'", |
| 3917 | "tmp.zig:23:5: error: expected type '*Allocator', found '*List'", |
| 3899 | 3918 | ); |
| 3900 | 3919 | |
| 3901 | 3920 | cases.add( |
| ... | ... | @@ -3906,7 +3925,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3906 | 3925 | \\ |
| 3907 | 3926 | \\export fn entry() usize { return @sizeOf(@typeOf(block_aligned_stuff)); } |
| 3908 | 3927 | , |
| 3909 | | ".tmp_source.zig:3:60: error: unable to perform binary not operation on type 'comptime_int'", |
| 3928 | "tmp.zig:3:60: error: unable to perform binary not operation on type 'comptime_int'", |
| 3910 | 3929 | ); |
| 3911 | 3930 | |
| 3912 | 3931 | cases.addCase(x: { |
| ... | ... | @@ -3918,7 +3937,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3918 | 3937 | \\ foo.privateFunction(); |
| 3919 | 3938 | \\} |
| 3920 | 3939 | , |
| 3921 | | ".tmp_source.zig:4:8: error: 'privateFunction' is private", |
| 3940 | "tmp.zig:4:8: error: 'privateFunction' is private", |
| 3922 | 3941 | "foo.zig:1:1: note: declared here", |
| 3923 | 3942 | ); |
| 3924 | 3943 | |
| ... | ... | @@ -3936,7 +3955,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3936 | 3955 | \\ |
| 3937 | 3956 | \\export fn entry() usize { return @sizeOf(@typeOf(a)); } |
| 3938 | 3957 | , |
| 3939 | | ".tmp_source.zig:2:11: error: expected type 'type', found 'i32'", |
| 3958 | "tmp.zig:2:11: error: expected type 'type', found 'i32'", |
| 3940 | 3959 | ); |
| 3941 | 3960 | |
| 3942 | 3961 | cases.add( |
| ... | ... | @@ -3949,7 +3968,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3949 | 3968 | \\ f.field = 0; |
| 3950 | 3969 | \\} |
| 3951 | 3970 | , |
| 3952 | | ".tmp_source.zig:6:13: error: cannot assign to constant", |
| 3971 | "tmp.zig:6:13: error: cannot assign to constant", |
| 3953 | 3972 | ); |
| 3954 | 3973 | |
| 3955 | 3974 | cases.add( |
| ... | ... | @@ -3970,7 +3989,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3970 | 3989 | \\ |
| 3971 | 3990 | \\export fn entry() usize { return @sizeOf(@typeOf(testTrickyDefer)); } |
| 3972 | 3991 | , |
| 3973 | | ".tmp_source.zig:4:11: error: cannot return from defer expression", |
| 3992 | "tmp.zig:4:11: error: cannot return from defer expression", |
| 3974 | 3993 | ); |
| 3975 | 3994 | |
| 3976 | 3995 | cases.add( |
| ... | ... | @@ -3985,8 +4004,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3985 | 4004 | \\ |
| 3986 | 4005 | \\export fn entry() usize { return @sizeOf(@typeOf(foo)); } |
| 3987 | 4006 | , |
| 3988 | | ".tmp_source.zig:2:26: error: index 1 outside argument list of size 1", |
| 3989 | | ".tmp_source.zig:6:15: note: called from here", |
| 4007 | "tmp.zig:2:26: error: index 1 outside argument list of size 1", |
| 4008 | "tmp.zig:6:15: note: called from here", |
| 3990 | 4009 | ); |
| 3991 | 4010 | |
| 3992 | 4011 | cases.add( |
| ... | ... | @@ -4005,7 +4024,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4005 | 4024 | \\ |
| 4006 | 4025 | \\export fn entry() usize { return @sizeOf(@typeOf(bar)); } |
| 4007 | 4026 | , |
| 4008 | | ".tmp_source.zig:10:16: error: compiler bug: integer and float literals in var args function must be casted", |
| 4027 | "tmp.zig:10:16: error: compiler bug: integer and float literals in var args function must be casted", |
| 4009 | 4028 | ); |
| 4010 | 4029 | |
| 4011 | 4030 | cases.add( |
| ... | ... | @@ -4014,7 +4033,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4014 | 4033 | \\ var vga_mem: u16 = 0xB8000; |
| 4015 | 4034 | \\} |
| 4016 | 4035 | , |
| 4017 | | ".tmp_source.zig:2:24: error: integer value 753664 cannot be implicitly casted to type 'u16'", |
| 4036 | "tmp.zig:2:24: error: integer value 753664 cannot be implicitly casted to type 'u16'", |
| 4018 | 4037 | ); |
| 4019 | 4038 | |
| 4020 | 4039 | cases.add( |
| ... | ... | @@ -4022,7 +4041,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4022 | 4041 | \\const some_data: [100]u8 align(3) = undefined; |
| 4023 | 4042 | \\export fn entry() usize { return @sizeOf(@typeOf(some_data)); } |
| 4024 | 4043 | , |
| 4025 | | ".tmp_source.zig:1:32: error: alignment value 3 is not a power of 2", |
| 4044 | "tmp.zig:1:32: error: alignment value 3 is not a power of 2", |
| 4026 | 4045 | ); |
| 4027 | 4046 | |
| 4028 | 4047 | cases.add( |
| ... | ... | @@ -4030,7 +4049,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4030 | 4049 | \\extern fn foo() align(3) void; |
| 4031 | 4050 | \\export fn entry() void { return foo(); } |
| 4032 | 4051 | , |
| 4033 | | ".tmp_source.zig:1:23: error: alignment value 3 is not a power of 2", |
| 4052 | "tmp.zig:1:23: error: alignment value 3 is not a power of 2", |
| 4034 | 4053 | ); |
| 4035 | 4054 | |
| 4036 | 4055 | cases.add( |
| ... | ... | @@ -4044,9 +4063,9 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4044 | 4063 | \\ @compileLog("end",); |
| 4045 | 4064 | \\} |
| 4046 | 4065 | , |
| 4047 | | ".tmp_source.zig:5:5: error: found compile log statement", |
| 4048 | | ".tmp_source.zig:6:5: error: found compile log statement", |
| 4049 | | ".tmp_source.zig:7:5: error: found compile log statement", |
| 4066 | "tmp.zig:5:5: error: found compile log statement", |
| 4067 | "tmp.zig:6:5: error: found compile log statement", |
| 4068 | "tmp.zig:7:5: error: found compile log statement", |
| 4050 | 4069 | ); |
| 4051 | 4070 | |
| 4052 | 4071 | cases.add( |
| ... | ... | @@ -4067,7 +4086,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4067 | 4086 | \\ |
| 4068 | 4087 | \\export fn entry() usize { return @sizeOf(@typeOf(foo)); } |
| 4069 | 4088 | , |
| 4070 | | ".tmp_source.zig:8:26: error: expected type '*const u3', found '*align(:3:1) const u3'", |
| 4089 | "tmp.zig:8:26: error: expected type '*const u3', found '*align(:3:1) const u3'", |
| 4071 | 4090 | ); |
| 4072 | 4091 | |
| 4073 | 4092 | cases.add( |
| ... | ... | @@ -4084,8 +4103,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4084 | 4103 | \\ if (!ok) unreachable; |
| 4085 | 4104 | \\} |
| 4086 | 4105 | , |
| 4087 | | ".tmp_source.zig:10:14: error: unable to evaluate constant expression", |
| 4088 | | ".tmp_source.zig:6:20: note: called from here", |
| 4106 | "tmp.zig:10:14: error: unable to evaluate constant expression", |
| 4107 | "tmp.zig:6:20: note: called from here", |
| 4089 | 4108 | ); |
| 4090 | 4109 | |
| 4091 | 4110 | cases.add( |
| ... | ... | @@ -4099,8 +4118,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4099 | 4118 | \\ |
| 4100 | 4119 | \\fn bar() void { } |
| 4101 | 4120 | , |
| 4102 | | ".tmp_source.zig:3:5: error: control flow attempts to use compile-time variable at runtime", |
| 4103 | | ".tmp_source.zig:3:24: note: compile-time variable assigned here", |
| 4121 | "tmp.zig:3:5: error: control flow attempts to use compile-time variable at runtime", |
| 4122 | "tmp.zig:3:24: note: compile-time variable assigned here", |
| 4104 | 4123 | ); |
| 4105 | 4124 | |
| 4106 | 4125 | cases.add( |
| ... | ... | @@ -4110,7 +4129,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4110 | 4129 | \\} |
| 4111 | 4130 | \\fn bar() i32 { return 0; } |
| 4112 | 4131 | , |
| 4113 | | ".tmp_source.zig:2:8: error: expression value is ignored", |
| 4132 | "tmp.zig:2:8: error: expression value is ignored", |
| 4114 | 4133 | ); |
| 4115 | 4134 | |
| 4116 | 4135 | cases.add( |
| ... | ... | @@ -4120,7 +4139,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4120 | 4139 | \\} |
| 4121 | 4140 | \\fn bar() anyerror!i32 { return 0; } |
| 4122 | 4141 | , |
| 4123 | | ".tmp_source.zig:2:11: error: expression value is ignored", |
| 4142 | "tmp.zig:2:11: error: expression value is ignored", |
| 4124 | 4143 | ); |
| 4125 | 4144 | |
| 4126 | 4145 | cases.add( |
| ... | ... | @@ -4129,7 +4148,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4129 | 4148 | \\ 1; |
| 4130 | 4149 | \\} |
| 4131 | 4150 | , |
| 4132 | | ".tmp_source.zig:2:5: error: expression value is ignored", |
| 4151 | "tmp.zig:2:5: error: expression value is ignored", |
| 4133 | 4152 | ); |
| 4134 | 4153 | |
| 4135 | 4154 | cases.add( |
| ... | ... | @@ -4138,7 +4157,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4138 | 4157 | \\ comptime {1;} |
| 4139 | 4158 | \\} |
| 4140 | 4159 | , |
| 4141 | | ".tmp_source.zig:2:15: error: expression value is ignored", |
| 4160 | "tmp.zig:2:15: error: expression value is ignored", |
| 4142 | 4161 | ); |
| 4143 | 4162 | |
| 4144 | 4163 | cases.add( |
| ... | ... | @@ -4147,7 +4166,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4147 | 4166 | \\ comptime 1; |
| 4148 | 4167 | \\} |
| 4149 | 4168 | , |
| 4150 | | ".tmp_source.zig:2:5: error: expression value is ignored", |
| 4169 | "tmp.zig:2:5: error: expression value is ignored", |
| 4151 | 4170 | ); |
| 4152 | 4171 | |
| 4153 | 4172 | cases.add( |
| ... | ... | @@ -4156,7 +4175,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4156 | 4175 | \\ defer {1;} |
| 4157 | 4176 | \\} |
| 4158 | 4177 | , |
| 4159 | | ".tmp_source.zig:2:12: error: expression value is ignored", |
| 4178 | "tmp.zig:2:12: error: expression value is ignored", |
| 4160 | 4179 | ); |
| 4161 | 4180 | |
| 4162 | 4181 | cases.add( |
| ... | ... | @@ -4166,7 +4185,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4166 | 4185 | \\} |
| 4167 | 4186 | \\fn bar() anyerror!i32 { return 0; } |
| 4168 | 4187 | , |
| 4169 | | ".tmp_source.zig:2:14: error: expression value is ignored", |
| 4188 | "tmp.zig:2:14: error: expression value is ignored", |
| 4170 | 4189 | ); |
| 4171 | 4190 | |
| 4172 | 4191 | cases.add( |
| ... | ... | @@ -4180,7 +4199,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4180 | 4199 | \\ |
| 4181 | 4200 | \\export fn entry() usize { return @sizeOf(@typeOf(pass)); } |
| 4182 | 4201 | , |
| 4183 | | ".tmp_source.zig:4:10: error: attempt to dereference non-pointer type '[10]u8'", |
| 4202 | "tmp.zig:4:10: error: attempt to dereference non-pointer type '[10]u8'", |
| 4184 | 4203 | ); |
| 4185 | 4204 | |
| 4186 | 4205 | cases.add( |
| ... | ... | @@ -4196,7 +4215,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4196 | 4215 | \\ |
| 4197 | 4216 | \\export fn entry() usize { return @sizeOf(@typeOf(foo)); } |
| 4198 | 4217 | , |
| 4199 | | ".tmp_source.zig:4:19: error: expected type '*[]const u8', found '*const []const u8'", |
| 4218 | "tmp.zig:4:19: error: expected type '*[]const u8', found '*const []const u8'", |
| 4200 | 4219 | ); |
| 4201 | 4220 | |
| 4202 | 4221 | cases.addCase(x: { |
| ... | ... | @@ -4209,7 +4228,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4209 | 4228 | \\} |
| 4210 | 4229 | , |
| 4211 | 4230 | "foo.zig:1:1: error: exported symbol collision: 'bar'", |
| 4212 | | ".tmp_source.zig:3:1: note: other symbol here", |
| 4231 | "tmp.zig:3:1: note: other symbol here", |
| 4213 | 4232 | ); |
| 4214 | 4233 | |
| 4215 | 4234 | tc.addSourceFile("foo.zig", |
| ... | ... | @@ -4228,7 +4247,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4228 | 4247 | \\ foo(global_array); |
| 4229 | 4248 | \\} |
| 4230 | 4249 | , |
| 4231 | | ".tmp_source.zig:4:9: error: expected type '[]i32', found '[10]i32'", |
| 4250 | "tmp.zig:4:9: error: expected type '[]i32', found '[10]i32'", |
| 4232 | 4251 | ); |
| 4233 | 4252 | |
| 4234 | 4253 | cases.add( |
| ... | ... | @@ -4237,7 +4256,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4237 | 4256 | \\ return @ptrCast(usize, a); |
| 4238 | 4257 | \\} |
| 4239 | 4258 | , |
| 4240 | | ".tmp_source.zig:2:21: error: expected pointer, found 'usize'", |
| 4259 | "tmp.zig:2:21: error: expected pointer, found 'usize'", |
| 4241 | 4260 | ); |
| 4242 | 4261 | |
| 4243 | 4262 | cases.add( |
| ... | ... | @@ -4254,7 +4273,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4254 | 4273 | \\ ); |
| 4255 | 4274 | \\} |
| 4256 | 4275 | , |
| 4257 | | ".tmp_source.zig:6:5: error: unable to evaluate constant expression", |
| 4276 | "tmp.zig:6:5: error: unable to evaluate constant expression", |
| 4258 | 4277 | ); |
| 4259 | 4278 | |
| 4260 | 4279 | cases.add( |
| ... | ... | @@ -4264,7 +4283,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4264 | 4283 | \\ const foo = builtin.Arch.x86; |
| 4265 | 4284 | \\} |
| 4266 | 4285 | , |
| 4267 | | ".tmp_source.zig:3:29: error: container 'Arch' has no member called 'x86'", |
| 4286 | "tmp.zig:3:29: error: container 'builtin.Arch' has no member called 'x86'", |
| 4268 | 4287 | ); |
| 4269 | 4288 | |
| 4270 | 4289 | cases.add( |
| ... | ... | @@ -4274,7 +4293,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4274 | 4293 | \\ var y: *void = @intToPtr(*void, x); |
| 4275 | 4294 | \\} |
| 4276 | 4295 | , |
| 4277 | | ".tmp_source.zig:3:30: error: type '*void' has 0 bits and cannot store information", |
| 4296 | "tmp.zig:3:30: error: type '*void' has 0 bits and cannot store information", |
| 4278 | 4297 | ); |
| 4279 | 4298 | |
| 4280 | 4299 | cases.add( |
| ... | ... | @@ -4284,7 +4303,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4284 | 4303 | \\ return @fieldParentPtr(Foo, "a", a); |
| 4285 | 4304 | \\} |
| 4286 | 4305 | , |
| 4287 | | ".tmp_source.zig:3:28: error: expected struct type, found 'i32'", |
| 4306 | "tmp.zig:3:28: error: expected struct type, found 'i32'", |
| 4288 | 4307 | ); |
| 4289 | 4308 | |
| 4290 | 4309 | cases.add( |
| ... | ... | @@ -4296,7 +4315,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4296 | 4315 | \\ return @fieldParentPtr(Foo, "a", a); |
| 4297 | 4316 | \\} |
| 4298 | 4317 | , |
| 4299 | | ".tmp_source.zig:5:33: error: struct 'Foo' has no field 'a'", |
| 4318 | "tmp.zig:5:33: error: struct 'Foo' has no field 'a'", |
| 4300 | 4319 | ); |
| 4301 | 4320 | |
| 4302 | 4321 | cases.add( |
| ... | ... | @@ -4308,7 +4327,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4308 | 4327 | \\ return @fieldParentPtr(Foo, "a", a); |
| 4309 | 4328 | \\} |
| 4310 | 4329 | , |
| 4311 | | ".tmp_source.zig:5:38: error: expected pointer, found 'i32'", |
| 4330 | "tmp.zig:5:38: error: expected pointer, found 'i32'", |
| 4312 | 4331 | ); |
| 4313 | 4332 | |
| 4314 | 4333 | cases.add( |
| ... | ... | @@ -4324,7 +4343,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4324 | 4343 | \\ const another_foo_ptr = @fieldParentPtr(Foo, "b", field_ptr); |
| 4325 | 4344 | \\} |
| 4326 | 4345 | , |
| 4327 | | ".tmp_source.zig:9:55: error: pointer value not based on parent struct", |
| 4346 | "tmp.zig:9:55: error: pointer value not based on parent struct", |
| 4328 | 4347 | ); |
| 4329 | 4348 | |
| 4330 | 4349 | cases.add( |
| ... | ... | @@ -4339,7 +4358,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4339 | 4358 | \\ const another_foo_ptr = @fieldParentPtr(Foo, "b", &foo.a); |
| 4340 | 4359 | \\} |
| 4341 | 4360 | , |
| 4342 | | ".tmp_source.zig:8:29: error: field 'b' has index 1 but pointer value is index 0 of struct 'Foo'", |
| 4361 | "tmp.zig:8:29: error: field 'b' has index 1 but pointer value is index 0 of struct 'Foo'", |
| 4343 | 4362 | ); |
| 4344 | 4363 | |
| 4345 | 4364 | cases.add( |
| ... | ... | @@ -4349,7 +4368,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4349 | 4368 | \\ return @byteOffsetOf(Foo, "a",); |
| 4350 | 4369 | \\} |
| 4351 | 4370 | , |
| 4352 | | ".tmp_source.zig:3:26: error: expected struct type, found 'i32'", |
| 4371 | "tmp.zig:3:26: error: expected struct type, found 'i32'", |
| 4353 | 4372 | ); |
| 4354 | 4373 | |
| 4355 | 4374 | cases.add( |
| ... | ... | @@ -4361,14 +4380,14 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4361 | 4380 | \\ return @byteOffsetOf(Foo, "a",); |
| 4362 | 4381 | \\} |
| 4363 | 4382 | , |
| 4364 | | ".tmp_source.zig:5:31: error: struct 'Foo' has no field 'a'", |
| 4383 | "tmp.zig:5:31: error: struct 'Foo' has no field 'a'", |
| 4365 | 4384 | ); |
| 4366 | 4385 | |
| 4367 | 4386 | cases.addExe( |
| 4368 | 4387 | "missing main fn in executable", |
| 4369 | 4388 | \\ |
| 4370 | 4389 | , |
| 4371 | | "error: no member named 'main' in '", |
| 4390 | "error: root source file has no member called 'main'", |
| 4372 | 4391 | ); |
| 4373 | 4392 | |
| 4374 | 4393 | cases.addExe( |
| ... | ... | @@ -4376,7 +4395,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4376 | 4395 | \\fn main() void {} |
| 4377 | 4396 | , |
| 4378 | 4397 | "error: 'main' is private", |
| 4379 | | ".tmp_source.zig:1:1: note: declared here", |
| 4398 | "tmp.zig:1:1: note: declared here", |
| 4380 | 4399 | ); |
| 4381 | 4400 | |
| 4382 | 4401 | cases.add( |
| ... | ... | @@ -4386,7 +4405,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4386 | 4405 | \\ return foo; |
| 4387 | 4406 | \\} |
| 4388 | 4407 | , |
| 4389 | | ".tmp_source.zig:1:33: error: cannot set section of external variable 'foo'", |
| 4408 | "tmp.zig:1:33: error: cannot set section of external variable 'foo'", |
| 4390 | 4409 | ); |
| 4391 | 4410 | |
| 4392 | 4411 | cases.add( |
| ... | ... | @@ -4396,7 +4415,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4396 | 4415 | \\ return foo; |
| 4397 | 4416 | \\} |
| 4398 | 4417 | , |
| 4399 | | ".tmp_source.zig:2:30: error: cannot set section of local variable 'foo'", |
| 4418 | "tmp.zig:2:30: error: cannot set section of local variable 'foo'", |
| 4400 | 4419 | ); |
| 4401 | 4420 | |
| 4402 | 4421 | cases.add( |
| ... | ... | @@ -4406,7 +4425,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4406 | 4425 | \\ foo(); |
| 4407 | 4426 | \\} |
| 4408 | 4427 | , |
| 4409 | | ".tmp_source.zig:1:29: error: cannot set section of external function 'foo'", |
| 4428 | "tmp.zig:1:29: error: cannot set section of external function 'foo'", |
| 4410 | 4429 | ); |
| 4411 | 4430 | |
| 4412 | 4431 | cases.add( |
| ... | ... | @@ -4416,7 +4435,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4416 | 4435 | \\ return &a; |
| 4417 | 4436 | \\} |
| 4418 | 4437 | , |
| 4419 | | ".tmp_source.zig:3:13: error: function returns address of local variable", |
| 4438 | "tmp.zig:3:13: error: function returns address of local variable", |
| 4420 | 4439 | ); |
| 4421 | 4440 | |
| 4422 | 4441 | cases.add( |
| ... | ... | @@ -4427,7 +4446,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4427 | 4446 | \\ return if (c) &a else &b; |
| 4428 | 4447 | \\} |
| 4429 | 4448 | , |
| 4430 | | ".tmp_source.zig:4:12: error: function returns address of local variable", |
| 4449 | "tmp.zig:4:12: error: function returns address of local variable", |
| 4431 | 4450 | ); |
| 4432 | 4451 | |
| 4433 | 4452 | cases.add( |
| ... | ... | @@ -4452,8 +4471,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4452 | 4471 | \\ if (!ok) unreachable; |
| 4453 | 4472 | \\} |
| 4454 | 4473 | , |
| 4455 | | ".tmp_source.zig:9:17: error: redefinition of 'Self'", |
| 4456 | | ".tmp_source.zig:5:9: note: previous definition is here", |
| 4474 | "tmp.zig:9:17: error: redefinition of 'Self'", |
| 4475 | "tmp.zig:5:9: note: previous definition is here", |
| 4457 | 4476 | ); |
| 4458 | 4477 | |
| 4459 | 4478 | cases.add( |
| ... | ... | @@ -4463,7 +4482,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4463 | 4482 | \\} |
| 4464 | 4483 | \\fn bar() ?i32 { return 1; } |
| 4465 | 4484 | , |
| 4466 | | ".tmp_source.zig:2:15: error: expected type 'bool', found '?i32'", |
| 4485 | "tmp.zig:2:15: error: expected type 'bool', found '?i32'", |
| 4467 | 4486 | ); |
| 4468 | 4487 | |
| 4469 | 4488 | cases.add( |
| ... | ... | @@ -4473,7 +4492,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4473 | 4492 | \\} |
| 4474 | 4493 | \\fn bar() anyerror!i32 { return 1; } |
| 4475 | 4494 | , |
| 4476 | | ".tmp_source.zig:2:15: error: expected type 'bool', found 'anyerror!i32'", |
| 4495 | "tmp.zig:2:15: error: expected type 'bool', found 'anyerror!i32'", |
| 4477 | 4496 | ); |
| 4478 | 4497 | |
| 4479 | 4498 | cases.add( |
| ... | ... | @@ -4483,7 +4502,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4483 | 4502 | \\} |
| 4484 | 4503 | \\fn bar() bool { return true; } |
| 4485 | 4504 | , |
| 4486 | | ".tmp_source.zig:2:15: error: expected optional type, found 'bool'", |
| 4505 | "tmp.zig:2:15: error: expected optional type, found 'bool'", |
| 4487 | 4506 | ); |
| 4488 | 4507 | |
| 4489 | 4508 | cases.add( |
| ... | ... | @@ -4493,7 +4512,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4493 | 4512 | \\} |
| 4494 | 4513 | \\fn bar() anyerror!i32 { return 1; } |
| 4495 | 4514 | , |
| 4496 | | ".tmp_source.zig:2:15: error: expected optional type, found 'anyerror!i32'", |
| 4515 | "tmp.zig:2:15: error: expected optional type, found 'anyerror!i32'", |
| 4497 | 4516 | ); |
| 4498 | 4517 | |
| 4499 | 4518 | cases.add( |
| ... | ... | @@ -4503,7 +4522,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4503 | 4522 | \\} |
| 4504 | 4523 | \\fn bar() bool { return true; } |
| 4505 | 4524 | , |
| 4506 | | ".tmp_source.zig:2:15: error: expected error union type, found 'bool'", |
| 4525 | "tmp.zig:2:15: error: expected error union type, found 'bool'", |
| 4507 | 4526 | ); |
| 4508 | 4527 | |
| 4509 | 4528 | cases.add( |
| ... | ... | @@ -4513,7 +4532,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4513 | 4532 | \\} |
| 4514 | 4533 | \\fn bar() ?i32 { return 1; } |
| 4515 | 4534 | , |
| 4516 | | ".tmp_source.zig:2:15: error: expected error union type, found '?i32'", |
| 4535 | "tmp.zig:2:15: error: expected error union type, found '?i32'", |
| 4517 | 4536 | ); |
| 4518 | 4537 | |
| 4519 | 4538 | cases.add( |
| ... | ... | @@ -4531,7 +4550,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4531 | 4550 | \\} |
| 4532 | 4551 | \\extern fn quux() void; |
| 4533 | 4552 | , |
| 4534 | | ".tmp_source.zig:4:1: error: unable to inline function", |
| 4553 | "tmp.zig:4:1: error: unable to inline function", |
| 4535 | 4554 | ); |
| 4536 | 4555 | |
| 4537 | 4556 | cases.add( |
| ... | ... | @@ -4542,7 +4561,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4542 | 4561 | \\inline fn bar() void { } |
| 4543 | 4562 | \\extern fn quux(usize) void; |
| 4544 | 4563 | , |
| 4545 | | ".tmp_source.zig:4:1: error: unable to inline function", |
| 4564 | "tmp.zig:4:1: error: unable to inline function", |
| 4546 | 4565 | ); |
| 4547 | 4566 | |
| 4548 | 4567 | cases.add( |
| ... | ... | @@ -4551,7 +4570,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4551 | 4570 | \\ return a / b; |
| 4552 | 4571 | \\} |
| 4553 | 4572 | , |
| 4554 | | ".tmp_source.zig:2:14: error: division with 'i32' and 'i32': signed integers must use @divTrunc, @divFloor, or @divExact", |
| 4573 | "tmp.zig:2:14: error: division with 'i32' and 'i32': signed integers must use @divTrunc, @divFloor, or @divExact", |
| 4555 | 4574 | ); |
| 4556 | 4575 | |
| 4557 | 4576 | cases.add( |
| ... | ... | @@ -4560,7 +4579,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4560 | 4579 | \\ return a % b; |
| 4561 | 4580 | \\} |
| 4562 | 4581 | , |
| 4563 | | ".tmp_source.zig:2:14: error: remainder division with 'i32' and 'i32': signed integers and floats must use @rem or @mod", |
| 4582 | "tmp.zig:2:14: error: remainder division with 'i32' and 'i32': signed integers and floats must use @rem or @mod", |
| 4564 | 4583 | ); |
| 4565 | 4584 | |
| 4566 | 4585 | cases.add( |
| ... | ... | @@ -4571,7 +4590,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4571 | 4590 | \\ const c = a / b; |
| 4572 | 4591 | \\} |
| 4573 | 4592 | , |
| 4574 | | ".tmp_source.zig:4:17: error: division by zero", |
| 4593 | "tmp.zig:4:17: error: division by zero", |
| 4575 | 4594 | ); |
| 4576 | 4595 | |
| 4577 | 4596 | cases.add( |
| ... | ... | @@ -4582,7 +4601,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4582 | 4601 | \\ const c = a % b; |
| 4583 | 4602 | \\} |
| 4584 | 4603 | , |
| 4585 | | ".tmp_source.zig:4:17: error: division by zero", |
| 4604 | "tmp.zig:4:17: error: division by zero", |
| 4586 | 4605 | ); |
| 4587 | 4606 | |
| 4588 | 4607 | cases.add( |
| ... | ... | @@ -4592,8 +4611,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4592 | 4611 | \\ @setRuntimeSafety(false); |
| 4593 | 4612 | \\} |
| 4594 | 4613 | , |
| 4595 | | ".tmp_source.zig:3:5: error: runtime safety set twice for same scope", |
| 4596 | | ".tmp_source.zig:2:5: note: first set here", |
| 4614 | "tmp.zig:3:5: error: runtime safety set twice for same scope", |
| 4615 | "tmp.zig:2:5: note: first set here", |
| 4597 | 4616 | ); |
| 4598 | 4617 | |
| 4599 | 4618 | cases.add( |
| ... | ... | @@ -4603,8 +4622,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4603 | 4622 | \\ @setFloatMode(@import("builtin").FloatMode.Optimized); |
| 4604 | 4623 | \\} |
| 4605 | 4624 | , |
| 4606 | | ".tmp_source.zig:3:5: error: float mode set twice for same scope", |
| 4607 | | ".tmp_source.zig:2:5: note: first set here", |
| 4625 | "tmp.zig:3:5: error: float mode set twice for same scope", |
| 4626 | "tmp.zig:2:5: note: first set here", |
| 4608 | 4627 | ); |
| 4609 | 4628 | |
| 4610 | 4629 | cases.add( |
| ... | ... | @@ -4613,7 +4632,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4613 | 4632 | \\ var b: u8[40] = undefined; |
| 4614 | 4633 | \\} |
| 4615 | 4634 | , |
| 4616 | | ".tmp_source.zig:2:14: error: array access of non-array type 'type'", |
| 4635 | "tmp.zig:2:14: error: array access of non-array type 'type'", |
| 4617 | 4636 | ); |
| 4618 | 4637 | |
| 4619 | 4638 | cases.add( |
| ... | ... | @@ -4626,7 +4645,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4626 | 4645 | \\ } |
| 4627 | 4646 | \\} |
| 4628 | 4647 | , |
| 4629 | | ".tmp_source.zig:4:13: error: cannot break out of defer expression", |
| 4648 | "tmp.zig:4:13: error: cannot break out of defer expression", |
| 4630 | 4649 | ); |
| 4631 | 4650 | |
| 4632 | 4651 | cases.add( |
| ... | ... | @@ -4639,7 +4658,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4639 | 4658 | \\ } |
| 4640 | 4659 | \\} |
| 4641 | 4660 | , |
| 4642 | | ".tmp_source.zig:4:13: error: cannot continue out of defer expression", |
| 4661 | "tmp.zig:4:13: error: cannot continue out of defer expression", |
| 4643 | 4662 | ); |
| 4644 | 4663 | |
| 4645 | 4664 | cases.add( |
| ... | ... | @@ -4653,7 +4672,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4653 | 4672 | \\ foos[0](); |
| 4654 | 4673 | \\} |
| 4655 | 4674 | , |
| 4656 | | ".tmp_source.zig:7:9: error: calling a generic function requires compile-time known function value", |
| 4675 | "tmp.zig:7:9: error: calling a generic function requires compile-time known function value", |
| 4657 | 4676 | ); |
| 4658 | 4677 | |
| 4659 | 4678 | cases.add( |
| ... | ... | @@ -4667,7 +4686,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4667 | 4686 | \\ foos[0](true); |
| 4668 | 4687 | \\} |
| 4669 | 4688 | , |
| 4670 | | ".tmp_source.zig:7:9: error: calling a generic function requires compile-time known function value", |
| 4689 | "tmp.zig:7:9: error: calling a generic function requires compile-time known function value", |
| 4671 | 4690 | ); |
| 4672 | 4691 | |
| 4673 | 4692 | cases.add( |
| ... | ... | @@ -4681,24 +4700,9 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4681 | 4700 | \\ return bar; |
| 4682 | 4701 | \\} |
| 4683 | 4702 | , |
| 4684 | | ".tmp_source.zig:1:13: error: aoeu", |
| 4685 | | ".tmp_source.zig:3:19: note: referenced here", |
| 4686 | | ".tmp_source.zig:7:12: note: referenced here", |
| 4687 | | ); |
| 4688 | | |
| 4689 | | cases.add( |
| 4690 | | "instantiating an undefined value for an invalid struct that contains itself", |
| 4691 | | \\const Foo = struct { |
| 4692 | | \\ x: Foo, |
| 4693 | | \\}; |
| 4694 | | \\ |
| 4695 | | \\var foo: Foo = undefined; |
| 4696 | | \\ |
| 4697 | | \\export fn entry() usize { |
| 4698 | | \\ return @sizeOf(@typeOf(foo.x)); |
| 4699 | | \\} |
| 4700 | | , |
| 4701 | | ".tmp_source.zig:1:13: error: struct 'Foo' contains itself", |
| 4703 | "tmp.zig:1:13: error: aoeu", |
| 4704 | "tmp.zig:3:19: note: referenced here", |
| 4705 | "tmp.zig:7:12: note: referenced here", |
| 4702 | 4706 | ); |
| 4703 | 4707 | |
| 4704 | 4708 | cases.add( |
| ... | ... | @@ -4707,7 +4711,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4707 | 4711 | \\ const a = 0x1.0p16384; |
| 4708 | 4712 | \\} |
| 4709 | 4713 | , |
| 4710 | | ".tmp_source.zig:2:15: error: float literal out of range of any type", |
| 4714 | "tmp.zig:2:15: error: float literal out of range of any type", |
| 4711 | 4715 | ); |
| 4712 | 4716 | |
| 4713 | 4717 | cases.add( |
| ... | ... | @@ -4716,7 +4720,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4716 | 4720 | \\ const a = 0x1.0p-16384; |
| 4717 | 4721 | \\} |
| 4718 | 4722 | , |
| 4719 | | ".tmp_source.zig:2:15: error: float literal out of range of any type", |
| 4723 | "tmp.zig:2:15: error: float literal out of range of any type", |
| 4720 | 4724 | ); |
| 4721 | 4725 | |
| 4722 | 4726 | cases.add( |
| ... | ... | @@ -4725,7 +4729,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4725 | 4729 | \\ return i32(12.34); |
| 4726 | 4730 | \\} |
| 4727 | 4731 | , |
| 4728 | | ".tmp_source.zig:2:16: error: fractional component prevents float value 12.340000 from being casted to type 'i32'", |
| 4732 | "tmp.zig:2:16: error: fractional component prevents float value 12.340000 from being casted to type 'i32'", |
| 4729 | 4733 | ); |
| 4730 | 4734 | |
| 4731 | 4735 | cases.add( |
| ... | ... | @@ -4734,7 +4738,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4734 | 4738 | \\ return @ptrToInt(x); |
| 4735 | 4739 | \\} |
| 4736 | 4740 | , |
| 4737 | | ".tmp_source.zig:2:22: error: expected pointer, found 'i32'", |
| 4741 | "tmp.zig:2:22: error: expected pointer, found 'i32'", |
| 4738 | 4742 | ); |
| 4739 | 4743 | |
| 4740 | 4744 | cases.add( |
| ... | ... | @@ -4743,7 +4747,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4743 | 4747 | \\ const x = @shlExact(u8(0b01010101), 2); |
| 4744 | 4748 | \\} |
| 4745 | 4749 | , |
| 4746 | | ".tmp_source.zig:2:15: error: operation caused overflow", |
| 4750 | "tmp.zig:2:15: error: operation caused overflow", |
| 4747 | 4751 | ); |
| 4748 | 4752 | |
| 4749 | 4753 | cases.add( |
| ... | ... | @@ -4752,7 +4756,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4752 | 4756 | \\ const x = @shrExact(u8(0b10101010), 2); |
| 4753 | 4757 | \\} |
| 4754 | 4758 | , |
| 4755 | | ".tmp_source.zig:2:15: error: exact shift shifted out 1 bits", |
| 4759 | "tmp.zig:2:15: error: exact shift shifted out 1 bits", |
| 4756 | 4760 | ); |
| 4757 | 4761 | |
| 4758 | 4762 | cases.add( |
| ... | ... | @@ -4761,7 +4765,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4761 | 4765 | \\ return 0x11 << x; |
| 4762 | 4766 | \\} |
| 4763 | 4767 | , |
| 4764 | | ".tmp_source.zig:2:17: error: LHS of shift must be an integer type, or RHS must be compile-time known", |
| 4768 | "tmp.zig:2:17: error: LHS of shift must be an integer type, or RHS must be compile-time known", |
| 4765 | 4769 | ); |
| 4766 | 4770 | |
| 4767 | 4771 | cases.add( |
| ... | ... | @@ -4770,7 +4774,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4770 | 4774 | \\ return x << y; |
| 4771 | 4775 | \\} |
| 4772 | 4776 | , |
| 4773 | | ".tmp_source.zig:2:17: error: expected type 'u3', found 'u8'", |
| 4777 | "tmp.zig:2:17: error: expected type 'u3', found 'u8'", |
| 4774 | 4778 | ); |
| 4775 | 4779 | |
| 4776 | 4780 | cases.add( |
| ... | ... | @@ -4780,7 +4784,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4780 | 4784 | \\ const a: u16 = 300; |
| 4781 | 4785 | \\} |
| 4782 | 4786 | , |
| 4783 | | ".tmp_source.zig:1:1: error: declaration shadows primitive type 'u16'", |
| 4787 | "tmp.zig:1:1: error: declaration shadows primitive type 'u16'", |
| 4784 | 4788 | ); |
| 4785 | 4789 | |
| 4786 | 4790 | cases.add( |
| ... | ... | @@ -4799,7 +4803,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4799 | 4803 | \\ x.* += 1; |
| 4800 | 4804 | \\} |
| 4801 | 4805 | , |
| 4802 | | ".tmp_source.zig:8:13: error: expected type '*u32', found '*align(1) u32'", |
| 4806 | "tmp.zig:8:13: error: expected type '*u32', found '*align(1) u32'", |
| 4803 | 4807 | ); |
| 4804 | 4808 | |
| 4805 | 4809 | cases.add( |
| ... | ... | @@ -4819,9 +4823,9 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4819 | 4823 | \\ x[0] += 1; |
| 4820 | 4824 | \\} |
| 4821 | 4825 | , |
| 4822 | | ".tmp_source.zig:9:18: error: cast increases pointer alignment", |
| 4823 | | ".tmp_source.zig:9:23: note: '*align(1) u32' has alignment 1", |
| 4824 | | ".tmp_source.zig:9:18: note: '*[1]u32' has alignment 4", |
| 4826 | "tmp.zig:9:18: error: cast increases pointer alignment", |
| 4827 | "tmp.zig:9:23: note: '*align(1) u32' has alignment 1", |
| 4828 | "tmp.zig:9:18: note: '*[1]u32' has alignment 4", |
| 4825 | 4829 | ); |
| 4826 | 4830 | |
| 4827 | 4831 | cases.add( |
| ... | ... | @@ -4832,9 +4836,9 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4832 | 4836 | \\ return ptr.*; |
| 4833 | 4837 | \\} |
| 4834 | 4838 | , |
| 4835 | | ".tmp_source.zig:3:17: error: cast increases pointer alignment", |
| 4836 | | ".tmp_source.zig:3:38: note: '*u8' has alignment 1", |
| 4837 | | ".tmp_source.zig:3:26: note: '*u32' has alignment 4", |
| 4839 | "tmp.zig:3:17: error: cast increases pointer alignment", |
| 4840 | "tmp.zig:3:38: note: '*u8' has alignment 1", |
| 4841 | "tmp.zig:3:26: note: '*u32' has alignment 4", |
| 4838 | 4842 | ); |
| 4839 | 4843 | |
| 4840 | 4844 | cases.add( |
| ... | ... | @@ -4843,7 +4847,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4843 | 4847 | \\ @alignCast(4, u32(3)); |
| 4844 | 4848 | \\} |
| 4845 | 4849 | , |
| 4846 | | ".tmp_source.zig:2:22: error: expected pointer or slice, found 'u32'", |
| 4850 | "tmp.zig:2:22: error: expected pointer or slice, found 'u32'", |
| 4847 | 4851 | ); |
| 4848 | 4852 | |
| 4849 | 4853 | cases.add( |
| ... | ... | @@ -4856,7 +4860,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4856 | 4860 | \\} |
| 4857 | 4861 | \\fn alignedSmall() align(4) i32 { return 1234; } |
| 4858 | 4862 | , |
| 4859 | | ".tmp_source.zig:2:35: error: expected type 'fn() align(8) i32', found 'fn() align(4) i32'", |
| 4863 | "tmp.zig:2:35: error: expected type 'fn() align(8) i32', found 'fn() align(4) i32'", |
| 4860 | 4864 | ); |
| 4861 | 4865 | |
| 4862 | 4866 | cases.add( |
| ... | ... | @@ -4868,7 +4872,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4868 | 4872 | \\ return x == 5678; |
| 4869 | 4873 | \\} |
| 4870 | 4874 | , |
| 4871 | | ".tmp_source.zig:4:32: error: expected type '*i32', found '*align(1) i32'", |
| 4875 | "tmp.zig:4:32: error: expected type '*i32', found '*align(1) i32'", |
| 4872 | 4876 | ); |
| 4873 | 4877 | |
| 4874 | 4878 | cases.add( |
| ... | ... | @@ -4877,7 +4881,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4877 | 4881 | \\ const array = [2]u8{1, 2, 3}; |
| 4878 | 4882 | \\} |
| 4879 | 4883 | , |
| 4880 | | ".tmp_source.zig:2:24: error: expected [2]u8 literal, found [3]u8 literal", |
| 4884 | "tmp.zig:2:24: error: expected [2]u8 literal, found [3]u8 literal", |
| 4881 | 4885 | ); |
| 4882 | 4886 | |
| 4883 | 4887 | cases.add( |
| ... | ... | @@ -4889,7 +4893,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4889 | 4893 | \\ bar(@ptrCast(*c_void, &x)); |
| 4890 | 4894 | \\} |
| 4891 | 4895 | , |
| 4892 | | ".tmp_source.zig:5:9: error: expected type '*Derp', found '*c_void'", |
| 4896 | "tmp.zig:5:9: error: expected type '*Derp', found '*c_void'", |
| 4893 | 4897 | ); |
| 4894 | 4898 | |
| 4895 | 4899 | cases.add( |
| ... | ... | @@ -4906,7 +4910,6 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4906 | 4910 | \\ var d = null; |
| 4907 | 4911 | \\ var e = opaque.*; |
| 4908 | 4912 | \\ var f = i32; |
| 4909 | | \\ var g = @import("std",); |
| 4910 | 4913 | \\ var h = (Foo {}).bar; |
| 4911 | 4914 | \\ |
| 4912 | 4915 | \\ var z: noreturn = return; |
| ... | ... | @@ -4916,16 +4919,15 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4916 | 4919 | \\ fn bar(self: *const Foo) void {} |
| 4917 | 4920 | \\}; |
| 4918 | 4921 | , |
| 4919 | | ".tmp_source.zig:4:4: error: variable of type '*comptime_int' must be const or comptime", |
| 4920 | | ".tmp_source.zig:7:4: error: variable of type '(undefined)' must be const or comptime", |
| 4921 | | ".tmp_source.zig:8:4: error: variable of type 'comptime_int' must be const or comptime", |
| 4922 | | ".tmp_source.zig:9:4: error: variable of type 'comptime_float' must be const or comptime", |
| 4923 | | ".tmp_source.zig:10:4: error: variable of type '(null)' must be const or comptime", |
| 4924 | | ".tmp_source.zig:11:4: error: variable of type 'Opaque' not allowed", |
| 4925 | | ".tmp_source.zig:12:4: error: variable of type 'type' must be const or comptime", |
| 4926 | | ".tmp_source.zig:13:4: error: variable of type '(namespace)' must be const or comptime", |
| 4927 | | ".tmp_source.zig:14:4: error: variable of type '(bound fn(*const Foo) void)' must be const or comptime", |
| 4928 | | ".tmp_source.zig:16:4: error: unreachable code", |
| 4922 | "tmp.zig:4:4: error: variable of type '*comptime_int' must be const or comptime", |
| 4923 | "tmp.zig:7:4: error: variable of type '(undefined)' must be const or comptime", |
| 4924 | "tmp.zig:8:4: error: variable of type 'comptime_int' must be const or comptime", |
| 4925 | "tmp.zig:9:4: error: variable of type 'comptime_float' must be const or comptime", |
| 4926 | "tmp.zig:10:4: error: variable of type '(null)' must be const or comptime", |
| 4927 | "tmp.zig:11:4: error: variable of type 'Opaque' not allowed", |
| 4928 | "tmp.zig:12:4: error: variable of type 'type' must be const or comptime", |
| 4929 | "tmp.zig:13:4: error: variable of type '(bound fn(*const Foo) void)' must be const or comptime", |
| 4930 | "tmp.zig:15:4: error: unreachable code", |
| 4929 | 4931 | ); |
| 4930 | 4932 | |
| 4931 | 4933 | cases.add( |
| ... | ... | @@ -4935,7 +4937,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4935 | 4937 | \\ while (!@cmpxchgWeak(i32, &x, 1234, 5678, u32(1234), u32(1234))) {} |
| 4936 | 4938 | \\} |
| 4937 | 4939 | , |
| 4938 | | ".tmp_source.zig:3:50: error: expected type 'AtomicOrder', found 'u32'", |
| 4940 | "tmp.zig:3:50: error: expected type 'builtin.AtomicOrder', found 'u32'", |
| 4939 | 4941 | ); |
| 4940 | 4942 | |
| 4941 | 4943 | cases.add( |
| ... | ... | @@ -4945,7 +4947,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4945 | 4947 | \\ @export("entry", entry, u32(1234)); |
| 4946 | 4948 | \\} |
| 4947 | 4949 | , |
| 4948 | | ".tmp_source.zig:3:32: error: expected type 'GlobalLinkage', found 'u32'", |
| 4950 | "tmp.zig:3:32: error: expected type 'builtin.GlobalLinkage', found 'u32'", |
| 4949 | 4951 | ); |
| 4950 | 4952 | |
| 4951 | 4953 | cases.add( |
| ... | ... | @@ -4974,7 +4976,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4974 | 4976 | \\ }; |
| 4975 | 4977 | \\} |
| 4976 | 4978 | , |
| 4977 | | ".tmp_source.zig:14:17: error: use of undeclared identifier 'HeaderValue'", |
| 4979 | "tmp.zig:14:17: error: use of undeclared identifier 'HeaderValue'", |
| 4978 | 4980 | ); |
| 4979 | 4981 | |
| 4980 | 4982 | cases.add( |
| ... | ... | @@ -4983,7 +4985,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4983 | 4985 | \\ @setAlignStack(16); |
| 4984 | 4986 | \\} |
| 4985 | 4987 | , |
| 4986 | | ".tmp_source.zig:2:5: error: @setAlignStack outside function", |
| 4988 | "tmp.zig:2:5: error: @setAlignStack outside function", |
| 4987 | 4989 | ); |
| 4988 | 4990 | |
| 4989 | 4991 | cases.add( |
| ... | ... | @@ -4992,7 +4994,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 4992 | 4994 | \\ @setAlignStack(16); |
| 4993 | 4995 | \\} |
| 4994 | 4996 | , |
| 4995 | | ".tmp_source.zig:2:5: error: @setAlignStack in naked function", |
| 4997 | "tmp.zig:2:5: error: @setAlignStack in naked function", |
| 4996 | 4998 | ); |
| 4997 | 4999 | |
| 4998 | 5000 | cases.add( |
| ... | ... | @@ -5004,7 +5006,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5004 | 5006 | \\ @setAlignStack(16); |
| 5005 | 5007 | \\} |
| 5006 | 5008 | , |
| 5007 | | ".tmp_source.zig:5:5: error: @setAlignStack in inline function", |
| 5009 | "tmp.zig:5:5: error: @setAlignStack in inline function", |
| 5008 | 5010 | ); |
| 5009 | 5011 | |
| 5010 | 5012 | cases.add( |
| ... | ... | @@ -5014,8 +5016,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5014 | 5016 | \\ @setAlignStack(16); |
| 5015 | 5017 | \\} |
| 5016 | 5018 | , |
| 5017 | | ".tmp_source.zig:3:5: error: alignstack set twice", |
| 5018 | | ".tmp_source.zig:2:5: note: first set here", |
| 5019 | "tmp.zig:3:5: error: alignstack set twice", |
| 5020 | "tmp.zig:2:5: note: first set here", |
| 5019 | 5021 | ); |
| 5020 | 5022 | |
| 5021 | 5023 | cases.add( |
| ... | ... | @@ -5024,7 +5026,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5024 | 5026 | \\ @setAlignStack(511 + 1); |
| 5025 | 5027 | \\} |
| 5026 | 5028 | , |
| 5027 | | ".tmp_source.zig:2:5: error: attempt to @setAlignStack(512); maximum is 256", |
| 5029 | "tmp.zig:2:5: error: attempt to @setAlignStack(512); maximum is 256", |
| 5028 | 5030 | ); |
| 5029 | 5031 | |
| 5030 | 5032 | cases.add( |
| ... | ... | @@ -5071,7 +5073,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5071 | 5073 | \\ } |
| 5072 | 5074 | \\} |
| 5073 | 5075 | , |
| 5074 | | ".tmp_source.zig:37:16: error: cannot store runtime value in compile time variable", |
| 5076 | "tmp.zig:37:16: error: cannot store runtime value in compile time variable", |
| 5075 | 5077 | ); |
| 5076 | 5078 | |
| 5077 | 5079 | cases.add( |
| ... | ... | @@ -5087,7 +5089,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5087 | 5089 | \\ return x.blah; |
| 5088 | 5090 | \\} |
| 5089 | 5091 | , |
| 5090 | | ".tmp_source.zig:9:13: error: type '*MyType' does not support field access", |
| 5092 | "tmp.zig:9:13: error: type '*MyType' does not support field access", |
| 5091 | 5093 | ); |
| 5092 | 5094 | |
| 5093 | 5095 | cases.add( |
| ... | ... | @@ -5095,7 +5097,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5095 | 5097 | "fn test() bool {\r\n" ++ |
| 5096 | 5098 | " true\r\n" ++ |
| 5097 | 5099 | "}\r\n", |
| 5098 | | ".tmp_source.zig:1:17: error: invalid carriage return, only '\\n' line endings are supported", |
| 5100 | "tmp.zig:1:17: error: invalid carriage return, only '\\n' line endings are supported", |
| 5099 | 5101 | ); |
| 5100 | 5102 | |
| 5101 | 5103 | cases.add( |
| ... | ... | @@ -5105,7 +5107,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5105 | 5107 | \\ true\r |
| 5106 | 5108 | \\} |
| 5107 | 5109 | , |
| 5108 | | ".tmp_source.zig:1:1: error: invalid character: '\\xff'", |
| 5110 | "tmp.zig:1:1: error: invalid character: '\\xff'", |
| 5109 | 5111 | ); |
| 5110 | 5112 | |
| 5111 | 5113 | cases.add( |
| ... | ... | @@ -5113,7 +5115,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5113 | 5115 | "fn test() bool {\n" ++ |
| 5114 | 5116 | "\ttrue\n" ++ |
| 5115 | 5117 | "}\n", |
| 5116 | | ".tmp_source.zig:2:1: error: invalid character: '\\t'", |
| 5118 | "tmp.zig:2:1: error: invalid character: '\\t'", |
| 5117 | 5119 | ); |
| 5118 | 5120 | |
| 5119 | 5121 | cases.add( |
| ... | ... | @@ -5122,7 +5124,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5122 | 5124 | \\ _ = @ArgType(i32, 3); |
| 5123 | 5125 | \\} |
| 5124 | 5126 | , |
| 5125 | | ".tmp_source.zig:2:18: error: expected function, found 'i32'", |
| 5127 | "tmp.zig:2:18: error: expected function, found 'i32'", |
| 5126 | 5128 | ); |
| 5127 | 5129 | |
| 5128 | 5130 | cases.add( |
| ... | ... | @@ -5132,7 +5134,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5132 | 5134 | \\} |
| 5133 | 5135 | \\fn add(a: i32, b: i32) i32 { return a + b; } |
| 5134 | 5136 | , |
| 5135 | | ".tmp_source.zig:2:32: error: arg index 2 out of bounds; 'fn(i32, i32) i32' has 2 arguments", |
| 5137 | "tmp.zig:2:32: error: arg index 2 out of bounds; 'fn(i32, i32) i32' has 2 arguments", |
| 5136 | 5138 | ); |
| 5137 | 5139 | |
| 5138 | 5140 | cases.add( |
| ... | ... | @@ -5141,7 +5143,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5141 | 5143 | \\ _ = @memberType(i32, 0); |
| 5142 | 5144 | \\} |
| 5143 | 5145 | , |
| 5144 | | ".tmp_source.zig:2:21: error: type 'i32' does not support @memberType", |
| 5146 | "tmp.zig:2:21: error: type 'i32' does not support @memberType", |
| 5145 | 5147 | ); |
| 5146 | 5148 | |
| 5147 | 5149 | cases.add( |
| ... | ... | @@ -5151,7 +5153,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5151 | 5153 | \\} |
| 5152 | 5154 | \\const Foo = enum {A,}; |
| 5153 | 5155 | , |
| 5154 | | ".tmp_source.zig:2:21: error: type 'Foo' does not support @memberType", |
| 5156 | "tmp.zig:2:21: error: type 'Foo' does not support @memberType", |
| 5155 | 5157 | ); |
| 5156 | 5158 | |
| 5157 | 5159 | cases.add( |
| ... | ... | @@ -5161,7 +5163,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5161 | 5163 | \\} |
| 5162 | 5164 | \\const Foo = struct {}; |
| 5163 | 5165 | , |
| 5164 | | ".tmp_source.zig:2:26: error: member index 0 out of bounds; 'Foo' has 0 members", |
| 5166 | "tmp.zig:2:26: error: member index 0 out of bounds; 'Foo' has 0 members", |
| 5165 | 5167 | ); |
| 5166 | 5168 | |
| 5167 | 5169 | cases.add( |
| ... | ... | @@ -5171,7 +5173,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5171 | 5173 | \\} |
| 5172 | 5174 | \\const Foo = union {A: void,}; |
| 5173 | 5175 | , |
| 5174 | | ".tmp_source.zig:2:26: error: member index 1 out of bounds; 'Foo' has 1 members", |
| 5176 | "tmp.zig:2:26: error: member index 1 out of bounds; 'Foo' has 1 members", |
| 5175 | 5177 | ); |
| 5176 | 5178 | |
| 5177 | 5179 | cases.add( |
| ... | ... | @@ -5180,7 +5182,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5180 | 5182 | \\ _ = @memberName(i32, 0); |
| 5181 | 5183 | \\} |
| 5182 | 5184 | , |
| 5183 | | ".tmp_source.zig:2:21: error: type 'i32' does not support @memberName", |
| 5185 | "tmp.zig:2:21: error: type 'i32' does not support @memberName", |
| 5184 | 5186 | ); |
| 5185 | 5187 | |
| 5186 | 5188 | cases.add( |
| ... | ... | @@ -5190,7 +5192,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5190 | 5192 | \\} |
| 5191 | 5193 | \\const Foo = struct {}; |
| 5192 | 5194 | , |
| 5193 | | ".tmp_source.zig:2:26: error: member index 0 out of bounds; 'Foo' has 0 members", |
| 5195 | "tmp.zig:2:26: error: member index 0 out of bounds; 'Foo' has 0 members", |
| 5194 | 5196 | ); |
| 5195 | 5197 | |
| 5196 | 5198 | cases.add( |
| ... | ... | @@ -5200,7 +5202,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5200 | 5202 | \\} |
| 5201 | 5203 | \\const Foo = enum {A,}; |
| 5202 | 5204 | , |
| 5203 | | ".tmp_source.zig:2:26: error: member index 1 out of bounds; 'Foo' has 1 members", |
| 5205 | "tmp.zig:2:26: error: member index 1 out of bounds; 'Foo' has 1 members", |
| 5204 | 5206 | ); |
| 5205 | 5207 | |
| 5206 | 5208 | cases.add( |
| ... | ... | @@ -5210,7 +5212,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5210 | 5212 | \\} |
| 5211 | 5213 | \\const Foo = union {A:i32,}; |
| 5212 | 5214 | , |
| 5213 | | ".tmp_source.zig:2:26: error: member index 1 out of bounds; 'Foo' has 1 members", |
| 5215 | "tmp.zig:2:26: error: member index 1 out of bounds; 'Foo' has 1 members", |
| 5214 | 5216 | ); |
| 5215 | 5217 | |
| 5216 | 5218 | cases.add( |
| ... | ... | @@ -5220,7 +5222,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5220 | 5222 | \\} |
| 5221 | 5223 | \\pub extern fn foo(format: *const u8, ...) void; |
| 5222 | 5224 | , |
| 5223 | | ".tmp_source.zig:2:9: error: expected type '*const u8', found '[5]u8'", |
| 5225 | "tmp.zig:2:9: error: expected type '*const u8', found '[5]u8'", |
| 5224 | 5226 | ); |
| 5225 | 5227 | |
| 5226 | 5228 | cases.add( |
| ... | ... | @@ -5239,9 +5241,9 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5239 | 5241 | \\ var allocator: ContextAllocator = undefined; |
| 5240 | 5242 | \\} |
| 5241 | 5243 | , |
| 5242 | | ".tmp_source.zig:4:25: error: aoeu", |
| 5243 | | ".tmp_source.zig:1:36: note: called from here", |
| 5244 | | ".tmp_source.zig:12:20: note: referenced here", |
| 5244 | "tmp.zig:4:25: error: aoeu", |
| 5245 | "tmp.zig:1:36: note: called from here", |
| 5246 | "tmp.zig:12:20: note: referenced here", |
| 5245 | 5247 | ); |
| 5246 | 5248 | |
| 5247 | 5249 | cases.add( |
| ... | ... | @@ -5258,7 +5260,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5258 | 5260 | \\ var x = Small.One; |
| 5259 | 5261 | \\} |
| 5260 | 5262 | , |
| 5261 | | ".tmp_source.zig:1:21: error: 'u2' too small to hold all bits; must be at least 'u3'", |
| 5263 | "tmp.zig:1:21: error: 'u2' too small to hold all bits; must be at least 'u3'", |
| 5262 | 5264 | ); |
| 5263 | 5265 | |
| 5264 | 5266 | cases.add( |
| ... | ... | @@ -5273,7 +5275,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5273 | 5275 | \\ var x = Small.One; |
| 5274 | 5276 | \\} |
| 5275 | 5277 | , |
| 5276 | | ".tmp_source.zig:1:21: error: expected integer, found 'f32'", |
| 5278 | "tmp.zig:1:21: error: expected integer, found 'f32'", |
| 5277 | 5279 | ); |
| 5278 | 5280 | |
| 5279 | 5281 | cases.add( |
| ... | ... | @@ -5289,7 +5291,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5289 | 5291 | \\ var x: u2 = Small.Two; |
| 5290 | 5292 | \\} |
| 5291 | 5293 | , |
| 5292 | | ".tmp_source.zig:9:22: error: expected type 'u2', found 'Small'", |
| 5294 | "tmp.zig:9:22: error: expected type 'u2', found 'Small'", |
| 5293 | 5295 | ); |
| 5294 | 5296 | |
| 5295 | 5297 | cases.add( |
| ... | ... | @@ -5306,7 +5308,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5306 | 5308 | \\ var x = @intToEnum(Small, y); |
| 5307 | 5309 | \\} |
| 5308 | 5310 | , |
| 5309 | | ".tmp_source.zig:10:31: error: expected type 'u2', found 'u3'", |
| 5311 | "tmp.zig:10:31: error: expected type 'u2', found 'u3'", |
| 5310 | 5312 | ); |
| 5311 | 5313 | |
| 5312 | 5314 | cases.add( |
| ... | ... | @@ -5322,7 +5324,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5322 | 5324 | \\ var y = Small.Two; |
| 5323 | 5325 | \\} |
| 5324 | 5326 | , |
| 5325 | | ".tmp_source.zig:1:20: error: expected unsigned integer, found 'i2'", |
| 5327 | "tmp.zig:1:20: error: expected unsigned integer, found 'i2'", |
| 5326 | 5328 | ); |
| 5327 | 5329 | |
| 5328 | 5330 | cases.add( |
| ... | ... | @@ -5334,7 +5336,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5334 | 5336 | \\ var x: MultipleChoice = undefined; |
| 5335 | 5337 | \\} |
| 5336 | 5338 | , |
| 5337 | | ".tmp_source.zig:2:14: error: enums, not structs, support field assignment", |
| 5339 | "tmp.zig:2:14: error: enums, not structs, support field assignment", |
| 5338 | 5340 | ); |
| 5339 | 5341 | |
| 5340 | 5342 | cases.add( |
| ... | ... | @@ -5346,8 +5348,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5346 | 5348 | \\ var x: MultipleChoice = undefined; |
| 5347 | 5349 | \\} |
| 5348 | 5350 | , |
| 5349 | | ".tmp_source.zig:2:14: error: non-enum union field assignment", |
| 5350 | | ".tmp_source.zig:1:24: note: consider 'union(enum)' here", |
| 5351 | "tmp.zig:2:14: error: non-enum union field assignment", |
| 5352 | "tmp.zig:1:24: note: consider 'union(enum)' here", |
| 5351 | 5353 | ); |
| 5352 | 5354 | |
| 5353 | 5355 | cases.add( |
| ... | ... | @@ -5357,7 +5359,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5357 | 5359 | \\ return @sizeOf(Foo); |
| 5358 | 5360 | \\} |
| 5359 | 5361 | , |
| 5360 | | ".tmp_source.zig:1:13: error: enums must have 1 or more fields", |
| 5362 | "tmp.zig:1:13: error: enums must have 1 or more fields", |
| 5361 | 5363 | ); |
| 5362 | 5364 | |
| 5363 | 5365 | cases.add( |
| ... | ... | @@ -5367,7 +5369,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5367 | 5369 | \\ return @sizeOf(Foo); |
| 5368 | 5370 | \\} |
| 5369 | 5371 | , |
| 5370 | | ".tmp_source.zig:1:13: error: unions must have 1 or more fields", |
| 5372 | "tmp.zig:1:13: error: unions must have 1 or more fields", |
| 5371 | 5373 | ); |
| 5372 | 5374 | |
| 5373 | 5375 | cases.add( |
| ... | ... | @@ -5383,8 +5385,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5383 | 5385 | \\ var x = MultipleChoice.C; |
| 5384 | 5386 | \\} |
| 5385 | 5387 | , |
| 5386 | | ".tmp_source.zig:6:9: error: enum tag value 60 already taken", |
| 5387 | | ".tmp_source.zig:4:9: note: other occurrence here", |
| 5388 | "tmp.zig:6:9: error: enum tag value 60 already taken", |
| 5389 | "tmp.zig:4:9: note: other occurrence here", |
| 5388 | 5390 | ); |
| 5389 | 5391 | |
| 5390 | 5392 | cases.add( |
| ... | ... | @@ -5402,8 +5404,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5402 | 5404 | \\ return @sizeOf(Payload); |
| 5403 | 5405 | \\} |
| 5404 | 5406 | , |
| 5405 | | ".tmp_source.zig:6:17: error: enum field missing: 'C'", |
| 5406 | | ".tmp_source.zig:4:5: note: declared here", |
| 5407 | "tmp.zig:6:17: error: enum field missing: 'C'", |
| 5408 | "tmp.zig:4:5: note: declared here", |
| 5407 | 5409 | ); |
| 5408 | 5410 | |
| 5409 | 5411 | cases.add( |
| ... | ... | @@ -5415,8 +5417,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5415 | 5417 | \\ const x = @TagType(Foo); |
| 5416 | 5418 | \\} |
| 5417 | 5419 | , |
| 5418 | | ".tmp_source.zig:5:24: error: union 'Foo' has no tag", |
| 5419 | | ".tmp_source.zig:1:13: note: consider 'union(enum)' here", |
| 5420 | "tmp.zig:5:24: error: union 'Foo' has no tag", |
| 5421 | "tmp.zig:1:13: note: consider 'union(enum)' here", |
| 5420 | 5422 | ); |
| 5421 | 5423 | |
| 5422 | 5424 | cases.add( |
| ... | ... | @@ -5428,7 +5430,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5428 | 5430 | \\ const x = @TagType(Foo); |
| 5429 | 5431 | \\} |
| 5430 | 5432 | , |
| 5431 | | ".tmp_source.zig:1:24: error: expected integer tag type, found 'f32'", |
| 5433 | "tmp.zig:1:24: error: expected integer tag type, found 'f32'", |
| 5432 | 5434 | ); |
| 5433 | 5435 | |
| 5434 | 5436 | cases.add( |
| ... | ... | @@ -5440,7 +5442,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5440 | 5442 | \\ const x = @TagType(Foo); |
| 5441 | 5443 | \\} |
| 5442 | 5444 | , |
| 5443 | | ".tmp_source.zig:1:19: error: expected enum tag type, found 'u32'", |
| 5445 | "tmp.zig:1:19: error: expected enum tag type, found 'u32'", |
| 5444 | 5446 | ); |
| 5445 | 5447 | |
| 5446 | 5448 | cases.add( |
| ... | ... | @@ -5456,8 +5458,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5456 | 5458 | \\ var x = MultipleChoice { .C = {} }; |
| 5457 | 5459 | \\} |
| 5458 | 5460 | , |
| 5459 | | ".tmp_source.zig:6:9: error: enum tag value 60 already taken", |
| 5460 | | ".tmp_source.zig:4:9: note: other occurrence here", |
| 5461 | "tmp.zig:6:9: error: enum tag value 60 already taken", |
| 5462 | "tmp.zig:4:9: note: other occurrence here", |
| 5461 | 5463 | ); |
| 5462 | 5464 | |
| 5463 | 5465 | cases.add( |
| ... | ... | @@ -5477,8 +5479,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5477 | 5479 | \\ var a = Payload {.A = 1234}; |
| 5478 | 5480 | \\} |
| 5479 | 5481 | , |
| 5480 | | ".tmp_source.zig:10:5: error: enum field not found: 'D'", |
| 5481 | | ".tmp_source.zig:1:16: note: enum declared here", |
| 5482 | "tmp.zig:10:5: error: enum field not found: 'D'", |
| 5483 | "tmp.zig:1:16: note: enum declared here", |
| 5482 | 5484 | ); |
| 5483 | 5485 | |
| 5484 | 5486 | cases.add( |
| ... | ... | @@ -5492,8 +5494,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5492 | 5494 | \\ var b = Letter.B; |
| 5493 | 5495 | \\} |
| 5494 | 5496 | , |
| 5495 | | ".tmp_source.zig:2:8: error: structs and unions, not enums, support field types", |
| 5496 | | ".tmp_source.zig:1:16: note: consider 'union(enum)' here", |
| 5497 | "tmp.zig:2:8: error: structs and unions, not enums, support field types", |
| 5498 | "tmp.zig:1:16: note: consider 'union(enum)' here", |
| 5497 | 5499 | ); |
| 5498 | 5500 | |
| 5499 | 5501 | cases.add( |
| ... | ... | @@ -5505,7 +5507,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5505 | 5507 | \\ var a = Letter { .A = {} }; |
| 5506 | 5508 | \\} |
| 5507 | 5509 | , |
| 5508 | | ".tmp_source.zig:2:5: error: struct field missing type", |
| 5510 | "tmp.zig:2:5: error: struct field missing type", |
| 5509 | 5511 | ); |
| 5510 | 5512 | |
| 5511 | 5513 | cases.add( |
| ... | ... | @@ -5517,7 +5519,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5517 | 5519 | \\ var a = Letter { .A = {} }; |
| 5518 | 5520 | \\} |
| 5519 | 5521 | , |
| 5520 | | ".tmp_source.zig:2:5: error: union field missing type", |
| 5522 | "tmp.zig:2:5: error: union field missing type", |
| 5521 | 5523 | ); |
| 5522 | 5524 | |
| 5523 | 5525 | cases.add( |
| ... | ... | @@ -5536,7 +5538,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5536 | 5538 | \\ var a = Payload { .A = 1234 }; |
| 5537 | 5539 | \\} |
| 5538 | 5540 | , |
| 5539 | | ".tmp_source.zig:6:30: error: extern union does not support enum tag type", |
| 5541 | "tmp.zig:6:30: error: extern union does not support enum tag type", |
| 5540 | 5542 | ); |
| 5541 | 5543 | |
| 5542 | 5544 | cases.add( |
| ... | ... | @@ -5555,7 +5557,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5555 | 5557 | \\ var a = Payload { .A = 1234 }; |
| 5556 | 5558 | \\} |
| 5557 | 5559 | , |
| 5558 | | ".tmp_source.zig:6:30: error: packed union does not support enum tag type", |
| 5560 | "tmp.zig:6:30: error: packed union does not support enum tag type", |
| 5559 | 5561 | ); |
| 5560 | 5562 | |
| 5561 | 5563 | cases.add( |
| ... | ... | @@ -5576,8 +5578,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5576 | 5578 | \\ } |
| 5577 | 5579 | \\} |
| 5578 | 5580 | , |
| 5579 | | ".tmp_source.zig:11:14: error: switch on union which has no attached enum", |
| 5580 | | ".tmp_source.zig:1:17: note: consider 'union(enum)' here", |
| 5581 | "tmp.zig:11:14: error: switch on union which has no attached enum", |
| 5582 | "tmp.zig:1:17: note: consider 'union(enum)' here", |
| 5581 | 5583 | ); |
| 5582 | 5584 | |
| 5583 | 5585 | cases.add( |
| ... | ... | @@ -5590,8 +5592,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5590 | 5592 | \\ var x = @intToEnum(Foo, 0); |
| 5591 | 5593 | \\} |
| 5592 | 5594 | , |
| 5593 | | ".tmp_source.zig:6:13: error: enum 'Foo' has no tag matching integer value 0", |
| 5594 | | ".tmp_source.zig:1:13: note: 'Foo' declared here", |
| 5595 | "tmp.zig:6:13: error: enum 'Foo' has no tag matching integer value 0", |
| 5596 | "tmp.zig:1:13: note: 'Foo' declared here", |
| 5595 | 5597 | ); |
| 5596 | 5598 | |
| 5597 | 5599 | cases.add( |
| ... | ... | @@ -5606,8 +5608,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5606 | 5608 | \\ var x: Value = Letter.A; |
| 5607 | 5609 | \\} |
| 5608 | 5610 | , |
| 5609 | | ".tmp_source.zig:8:26: error: cast to union 'Value' must initialize 'i32' field 'A'", |
| 5610 | | ".tmp_source.zig:3:5: note: field 'A' declared here", |
| 5611 | "tmp.zig:8:26: error: cast to union 'Value' must initialize 'i32' field 'A'", |
| 5612 | "tmp.zig:3:5: note: field 'A' declared here", |
| 5611 | 5613 | ); |
| 5612 | 5614 | |
| 5613 | 5615 | cases.add( |
| ... | ... | @@ -5625,8 +5627,8 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5625 | 5627 | \\ var x: Value = l; |
| 5626 | 5628 | \\} |
| 5627 | 5629 | , |
| 5628 | | ".tmp_source.zig:11:20: error: runtime cast to union 'Value' which has non-void fields", |
| 5629 | | ".tmp_source.zig:3:5: note: field 'A' has type 'i32'", |
| 5630 | "tmp.zig:11:20: error: runtime cast to union 'Value' which has non-void fields", |
| 5631 | "tmp.zig:3:5: note: field 'A' has type 'i32'", |
| 5630 | 5632 | ); |
| 5631 | 5633 | |
| 5632 | 5634 | cases.add( |
| ... | ... | @@ -5638,7 +5640,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5638 | 5640 | \\ const fieldOffset = @byteOffsetOf(Empty, "val",); |
| 5639 | 5641 | \\} |
| 5640 | 5642 | , |
| 5641 | | ".tmp_source.zig:5:46: error: zero-bit field 'val' in struct 'Empty' has no offset", |
| 5643 | "tmp.zig:5:46: error: zero-bit field 'val' in struct 'Empty' has no offset", |
| 5642 | 5644 | ); |
| 5643 | 5645 | |
| 5644 | 5646 | cases.add( |
| ... | ... | @@ -5650,7 +5652,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5650 | 5652 | \\ const fieldOffset = @bitOffsetOf(Empty, "val",); |
| 5651 | 5653 | \\} |
| 5652 | 5654 | , |
| 5653 | | ".tmp_source.zig:5:45: error: zero-bit field 'val' in struct 'Empty' has no offset", |
| 5655 | "tmp.zig:5:45: error: zero-bit field 'val' in struct 'Empty' has no offset", |
| 5654 | 5656 | ); |
| 5655 | 5657 | |
| 5656 | 5658 | cases.add( |
| ... | ... | @@ -5664,7 +5666,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5664 | 5666 | \\ const bar_val = foo.Bar; |
| 5665 | 5667 | \\} |
| 5666 | 5668 | , |
| 5667 | | ".tmp_source.zig:7:24: error: accessing union field 'Bar' while field 'Baz' is set", |
| 5669 | "tmp.zig:7:24: error: accessing union field 'Bar' while field 'Baz' is set", |
| 5668 | 5670 | ); |
| 5669 | 5671 | |
| 5670 | 5672 | cases.add( |
| ... | ... | @@ -5674,7 +5676,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5674 | 5676 | \\ _ = @typeOf(generic).ReturnType; |
| 5675 | 5677 | \\} |
| 5676 | 5678 | , |
| 5677 | | ".tmp_source.zig:3:25: error: ReturnType has not been resolved because 'fn(var)var' is generic", |
| 5679 | "tmp.zig:3:25: error: ReturnType has not been resolved because 'fn(var)var' is generic", |
| 5678 | 5680 | ); |
| 5679 | 5681 | |
| 5680 | 5682 | cases.add( |
| ... | ... | @@ -5684,7 +5686,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5684 | 5686 | \\ _ = @ArgType(@typeOf(generic), 0); |
| 5685 | 5687 | \\} |
| 5686 | 5688 | , |
| 5687 | | ".tmp_source.zig:3:36: error: @ArgType could not resolve the type of arg 0 because 'fn(var)var' is generic", |
| 5689 | "tmp.zig:3:36: error: @ArgType could not resolve the type of arg 0 because 'fn(var)var' is generic", |
| 5688 | 5690 | ); |
| 5689 | 5691 | |
| 5690 | 5692 | cases.add( |
| ... | ... | @@ -5694,7 +5696,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5694 | 5696 | \\ asm volatile ("" : [baz]"+r"(bar) : : ""); |
| 5695 | 5697 | \\} |
| 5696 | 5698 | , |
| 5697 | | ".tmp_source.zig:3:5: error: invalid modifier starting output constraint for 'baz': '+', only '=' is supported. Compiler TODO: see https://github.com/ziglang/zig/issues/215", |
| 5699 | "tmp.zig:3:5: error: invalid modifier starting output constraint for 'baz': '+', only '=' is supported. Compiler TODO: see https://github.com/ziglang/zig/issues/215", |
| 5698 | 5700 | ); |
| 5699 | 5701 | |
| 5700 | 5702 | cases.add( |
| ... | ... | @@ -5703,7 +5705,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5703 | 5705 | \\ asm volatile ("" : : [bar]"r"(3) : ""); |
| 5704 | 5706 | \\} |
| 5705 | 5707 | , |
| 5706 | | ".tmp_source.zig:2:35: error: expected sized integer or sized float, found comptime_int", |
| 5708 | "tmp.zig:2:35: error: expected sized integer or sized float, found comptime_int", |
| 5707 | 5709 | ); |
| 5708 | 5710 | |
| 5709 | 5711 | cases.add( |
| ... | ... | @@ -5712,7 +5714,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5712 | 5714 | \\ asm volatile ("" : : [bar]"r"(3.17) : ""); |
| 5713 | 5715 | \\} |
| 5714 | 5716 | , |
| 5715 | | ".tmp_source.zig:2:35: error: expected sized integer or sized float, found comptime_float", |
| 5717 | "tmp.zig:2:35: error: expected sized integer or sized float, found comptime_float", |
| 5716 | 5718 | ); |
| 5717 | 5719 | |
| 5718 | 5720 | cases.add( |
| ... | ... | @@ -5726,7 +5728,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5726 | 5728 | \\ const foo = Foo { .Bar = x, .Baz = u8 }; |
| 5727 | 5729 | \\} |
| 5728 | 5730 | , |
| 5729 | | ".tmp_source.zig:7:30: error: unable to evaluate constant expression", |
| 5731 | "tmp.zig:7:30: error: unable to evaluate constant expression", |
| 5730 | 5732 | ); |
| 5731 | 5733 | |
| 5732 | 5734 | cases.add( |
| ... | ... | @@ -5740,7 +5742,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5740 | 5742 | \\ const foo = Foo { .Bar = x }; |
| 5741 | 5743 | \\} |
| 5742 | 5744 | , |
| 5743 | | ".tmp_source.zig:7:30: error: unable to evaluate constant expression", |
| 5745 | "tmp.zig:7:30: error: unable to evaluate constant expression", |
| 5744 | 5746 | ); |
| 5745 | 5747 | |
| 5746 | 5748 | cases.addTest( |
| ... | ... | @@ -5750,7 +5752,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5750 | 5752 | \\ var v: V = undefined; |
| 5751 | 5753 | \\} |
| 5752 | 5754 | , |
| 5753 | | ".tmp_source.zig:2:26: error: vector element type must be integer, float, or pointer; '@Vector(4, u8)' is invalid", |
| 5755 | "tmp.zig:2:26: error: vector element type must be integer, float, or pointer; '@Vector(4, u8)' is invalid", |
| 5754 | 5756 | ); |
| 5755 | 5757 | |
| 5756 | 5758 | cases.add("compileLog of tagged enum doesn't crash the compiler", |
| ... | ... | @@ -5765,5 +5767,5 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5765 | 5767 | \\pub fn main () void { |
| 5766 | 5768 | \\ comptime testCompileLog(Bar{.X = 123}); |
| 5767 | 5769 | \\} |
| 5768 | | , ".tmp_source.zig:6:5: error: found compile log statement"); |
| 5770 | , "tmp.zig:6:5: error: found compile log statement"); |
| 5769 | 5771 | } |