aboutsummaryrefslogtreecommitdiff
path: root/src/Module.zig
diff options
context:
space:
mode:
authorVeikka Tuominen <git@vexu.eu>2022-08-21 18:04:46 +0300
committerVeikka Tuominen <git@vexu.eu>2022-08-22 11:16:36 +0300
commitb55a5007faad1de054e86e00bfdc9a58e5fc4ff8 (patch)
treee0c0713b6056b24f48e614805225739e8069f420 /src/Module.zig
parentb2f02a820f1ed46721ed55243cead52efed055d7 (diff)
downloadzig-b55a5007faad1de054e86e00bfdc9a58e5fc4ff8.tar.gz
zig-b55a5007faad1de054e86e00bfdc9a58e5fc4ff8.zip
Sema: fix parameter of type 'T' must be comptime error
Closes #12519 Closes #12505
Diffstat (limited to 'src/Module.zig')
-rw-r--r--src/Module.zig8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Module.zig b/src/Module.zig
index 3577115ded..45e0779c54 100644
--- a/src/Module.zig
+++ b/src/Module.zig
@@ -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(