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>
This commit is contained in:
committed by
Veikka Tuominen
parent
da95da438e
commit
ae8d26a6a0
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user