diff options
| author | antlilja <liljaanton2001@gmail.com> | 2022-08-06 22:32:00 +0200 |
|---|---|---|
| committer | Veikka Tuominen <git@vexu.eu> | 2022-08-27 11:17:48 +0300 |
| commit | ae8d26a6a00a528bdf555689c2a93cb35a3287f2 (patch) | |
| tree | d72b651523e62b81d0b1733cf2f1a4eced7265db /test/behavior/union.zig | |
| parent | da95da438ed5c934a9f42811651f5ffa524e48a8 (diff) | |
| download | zig-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/union.zig')
| -rw-r--r-- | test/behavior/union.zig | 2 |
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); |
