zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 579694893ee082ed829b017694fece4e7f41946f (tree)
parent 2cee19ab217968b50aa1be821a53693fc1537333
Author: Andrew Kelley <andrew@ziglang.org>
Date:   Thu, 13 May 2021 20:09:25 -0700

Sema: remove compile error for comptime function calls

Not sure why that was there - comptime function calls are already
implemented!

Diffstat:
Msrc/Sema.zig | 19++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/src/Sema.zig b/src/Sema.zig @@ -2147,11 +2147,20 @@ fn analyzeCall( ); } - if (modifier == .compile_time) { - return sema.mod.fail(&block.base, call_src, "TODO implement comptime function calls", .{}); - } - if (modifier != .auto) { - return sema.mod.fail(&block.base, call_src, "TODO implement call with modifier {}", .{modifier}); + switch (modifier) { + .auto, + .always_inline, + .compile_time, + => {}, + + .async_kw, + .never_tail, + .never_inline, + .no_async, + .always_tail, + => return sema.mod.fail(&block.base, call_src, "TODO implement call with modifier {}", .{ + modifier, + }), } // TODO handle function calls of generic functions