aboutsummaryrefslogtreecommitdiff
path: root/test/behavior
diff options
context:
space:
mode:
authorantlilja <liljaanton2001@gmail.com>2022-08-06 22:32:00 +0200
committerVeikka Tuominen <git@vexu.eu>2022-08-27 11:17:48 +0300
commitae8d26a6a00a528bdf555689c2a93cb35a3287f2 (patch)
treed72b651523e62b81d0b1733cf2f1a4eced7265db /test/behavior
parentda95da438ed5c934a9f42811651f5ffa524e48a8 (diff)
downloadzig-ae8d26a6a00a528bdf555689c2a93cb35a3287f2.tar.gz
zig-ae8d26a6a00a528bdf555689c2a93cb35a3287f2.zip
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 <git@vexu.eu>
Diffstat (limited to 'test/behavior')
-rw-r--r--test/behavior/union.zig2
1 files changed, 1 insertions, 1 deletions
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);