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 /lib/std/meta.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 'lib/std/meta.zig')
| -rw-r--r-- | lib/std/meta.zig | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/std/meta.zig b/lib/std/meta.zig index 937b1998ff..7e64eff49f 100644 --- a/lib/std/meta.zig +++ b/lib/std/meta.zig @@ -764,7 +764,7 @@ const TagPayloadType = TagPayload; ///Given a tagged union type, and an enum, return the type of the union /// field corresponding to the enum tag. -pub fn TagPayload(comptime U: type, tag: Tag(U)) type { +pub fn TagPayload(comptime U: type, comptime tag: Tag(U)) type { comptime debug.assert(trait.is(.Union)(U)); const info = @typeInfo(U).Union; |
