authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-01-06 23:03:07-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-01-06 23:03:07-05:00
log8492c46aded997240dbda201374fc84a7b3cf16b
tree1846b68e469530dcdb6498d9149b59dcd2a585ec
parent8c640b3e604e597ba49abbda39bd97c379072a3a
signaturelock-open Commit is signed but in an unrecognized format.

add test case for already fixed bug

closes #2655

1 files changed, 12 insertions(+), 0 deletions(-)

test/compile_errors.zig+12
......@@ -2,6 +2,18 @@ const tests = @import("tests.zig");
22const builtin = @import("builtin");
33
44pub fn addCases(cases: *tests.CompileErrorContext) void {
5 cases.addTest("repeated invalid field access to generic function returning type crashes compiler. #2655",
6 \\pub fn A() type {
7 \\ return Q;
8 \\}
9 \\test "1" {
10 \\ _ = A().a;
11 \\ _ = A().a;
12 \\}
13 , &[_][]const u8{
14 "tmp.zig:2:12: error: use of undeclared identifier 'Q'",
15 });
16
517 cases.add("bitCast to enum type",
618 \\export fn entry() void {
719 \\ const y = @bitCast(enum(u32) { a, b }, @as(u32, 3));