authorgravatar for noam@pixelhero.devNoam Preil <noam@pixelhero.dev> 2020-06-27 21:10:44-04:00
committergravatar for noam@pixelhero.devNoam Preil <noam@pixelhero.dev> 2020-06-27 21:10:44-04:00
log97c41e71521a66e3e117bc23cf51d047b119eb9a
tree33c5ebd4e520de169f36081a63b9a5224fbe9021
parent54148a8c888f47361c141f0635671e1ed12ddba4
signaturelock-open Commit is signed but in an unrecognized format.

Disable test


2 files changed, 24 insertions(+), 25 deletions(-)

src-self-hosted/Module.zig+1-7
......@@ -1696,13 +1696,7 @@ fn analyzeRootSrcFile(self: *Module, root_scope: *Scope.File) !void {
16961696 if (src_decl.cast(ast.Node.FnProto)) |fn_proto| {
16971697 // We will create a Decl for it regardless of analysis status.
16981698 const name_tok = fn_proto.name_token orelse {
1699 const err_msg = try ErrorMsg.create(self.allocator, tree.token_locs[fn_proto.firstToken()].end, "missing function name", .{});
1700 // TODO: cache a single invalid decl in the Module?
1701 const new_decl = try self.createNewDecl(&root_scope.base, "", decl_i, [1]u8{0} ** 16, [1]u8{0} ** 16);
1702 root_scope.decls.appendAssumeCapacity(new_decl);
1703 errdefer err_msg.destroy(self.allocator);
1704 try self.failed_decls.putNoClobber(new_decl, err_msg);
1705 continue;
1699 @panic("TODO missing function name");
17061700 };
17071701
17081702 const name_loc = tree.token_locs[name_tok];
test/stage2/compile_errors.zig+23-18
......@@ -62,26 +62,31 @@ pub fn addCases(ctx: *TestContext) !void {
6262 \\@1 = export(@0, "start")
6363 );
6464
65 ctx.incrementalFailure("function redefinition", linux_x64,
65 ctx.compileError("function redefinition", linux_x64,
6666 \\fn entry() void {}
6767 \\fn entry() void {}
68 , &[_][]const u8{":2:4: error: redefinition of 'entry'"},
69 \\fn entry() void {}
70 );
71
72 // TODO: need to make sure this works with other variants of export.
73 ctx.incrementalFailure("exported symbol collision", linux_x64,
74 \\export fn entry() void {}
75 \\export fn entry() void {}
76 , &[_][]const u8{":2:11: error: redefinition of 'entry'"},
77 \\export fn entry() void {}
78 );
79
80 ctx.incrementalFailure("missing function name", linux_x64,
81 \\fn() void {}
82 , &[_][]const u8{":1:3: error: missing function name"},
83 \\fn a() void {}
84 );
68 , &[_][]const u8{":2:4: error: redefinition of 'entry'"});
69
70 //ctx.incrementalFailure("function redefinition", linux_x64,
71 // \\fn entry() void {}
72 // \\fn entry() void {}
73 //, &[_][]const u8{":2:4: error: redefinition of 'entry'"},
74 // \\fn entry() void {}
75 //);
76
77 //// TODO: need to make sure this works with other variants of export.
78 //ctx.incrementalFailure("exported symbol collision", linux_x64,
79 // \\export fn entry() void {}
80 // \\export fn entry() void {}
81 //, &[_][]const u8{":2:11: error: redefinition of 'entry'"},
82 // \\export fn entry() void {}
83 //);
84
85 // ctx.incrementalFailure("missing function name", linux_x64,
86 // \\fn() void {}
87 // , &[_][]const u8{":1:3: error: missing function name"},
88 // \\fn a() void {}
89 // );
8590
8691 // TODO: re-enable these tests.
8792 // https://github.com/ziglang/zig/issues/1364