Sema: fix parameter of type 'T' must be comptime error

Closes #12519
Closes #12505
This commit is contained in:
Veikka Tuominen committed 2022-08-22 11:16:36 +03:00
1 parent b2f02a820f
commit b55a5007fa
14 files changed
+51 -22

No files matched your search

+4 -4
View File
@@ -6072,17 +6072,17 @@ pub fn paramSrc(
else => unreachable,
};
var it = full.iterate(tree);
while (true) {
if (it.param_i == param_i) {
const param = it.next().?;
var i: usize = 0;
while (it.next()) |param| : (i += 1) {
if (i == param_i) {
if (param.anytype_ellipsis3) |some| {
const main_token = tree.nodes.items(.main_token)[decl.src_node];
return .{ .token_offset_param = @bitCast(i32, some) - @bitCast(i32, main_token) };
}
return .{ .node_offset_param = decl.nodeIndexToRelative(param.type_expr) };
}
_ = it.next();
}
unreachable;
}
pub fn argSrc(