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:
antlilja
2022-08-06 22:32:00 +02:00
committed by Veikka Tuominen
parent da95da438e
commit ae8d26a6a0
10 changed files with 95 additions and 26 deletions

View File

@@ -459,7 +459,7 @@ pub fn MultiArrayList(comptime S: type) type {
return self.bytes[0..capacityInBytes(self.capacity)];
}
fn FieldType(field: Field) type {
fn FieldType(comptime field: Field) type {
return meta.fieldInfo(S, field).field_type;
}