From ae8d26a6a00a528bdf555689c2a93cb35a3287f2 Mon Sep 17 00:00:00 2001 From: antlilja Date: Sat, 6 Aug 2022 22:32:00 +0200 Subject: Sema: add error for non-comptime param in comptime func Adds error for taking a non comptime parameter in a function returning a comptime-only type but not when that type is dependent on a parameter. Co-authored-by: Veikka Tuominen --- test/behavior/union.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/behavior') diff --git a/test/behavior/union.zig b/test/behavior/union.zig index e2078c66df..5d6b084be5 100644 --- a/test/behavior/union.zig +++ b/test/behavior/union.zig @@ -745,7 +745,7 @@ fn setAttribute(attr: Attribute) void { _ = attr; } -fn Setter(attr: Attribute) type { +fn Setter(comptime attr: Attribute) type { return struct { fn set() void { setAttribute(attr); -- cgit v1.2.3