mirror of
https://github.com/ziglang/zig.git
synced 2026-12-05 19:18:46 -05:00
Sema: fix fn_proto_param LazySrcLoc resolution
to match source code span from merge-base.
This commit is contained in:
1 parent
727b371bbc
commit
8daa8d255b
5 files changed
+14
-7
No files matched your search
+9
-2
@@ -2152,8 +2152,15 @@ pub const SrcLoc = struct {
|
||||
while (it.next()) |param| : (i += 1) {
|
||||
if (i == fn_proto_param.param_index) {
|
||||
if (param.anytype_ellipsis3) |token| return tokenToSpan(tree, token);
|
||||
if (param.name_token) |token| return tokenToSpan(tree, token);
|
||||
return nodeToSpan(tree, param.type_expr);
|
||||
const first_token = param.comptime_noalias orelse
|
||||
param.name_token orelse
|
||||
tree.firstToken(param.type_expr);
|
||||
return tokensToSpan(
|
||||
tree,
|
||||
first_token,
|
||||
tree.lastToken(param.type_expr),
|
||||
first_token,
|
||||
);
|
||||
}
|
||||
}
|
||||
unreachable;
|
||||
|
||||
Reference in new issue
Block a user