@@ -2117,10 +2117,10 @@ fn comptimeExprAst(
21172117 node: Ast.Node.Index,
21182118) InnerError!Zir.Inst.Ref {
21192119 const astgen = gz.astgen;
2120+ const tree = astgen.tree;
21202121 if (gz.is_comptime) {
2121- try astgen.appendErrorNode( node, "redundant comptime keyword in already comptime scope", .{});
2122+ try astgen.appendErrorTok(tree.nodeMainToken( node) , "redundant comptime keyword in already comptime scope", .{});
21222123 }
2123- const tree = astgen.tree;
21242124 const body_node = tree.nodeData(node).node;
21252125 return comptimeExpr2(gz, scope, ri, body_node, node, .comptime_keyword);
21262126}
@@ -3469,7 +3469,7 @@ fn assignDestructure(gz: *GenZir, scope: *Scope, node: Ast.Node.Index) InnerErro
34693469
34703470 const full = tree.assignDestructure(node);
34713471 if (full.comptime_token != null and gz.is_comptime) {
3472- return astgen.appendErrorNode(node , "redundant comptime keyword in already comptime scope", .{});
3472+ return astgen.appendErrorTok(full.comptime_token.? , "redundant comptime keyword in already comptime scope", .{});
34733473 }
34743474
34753475 // If this expression is marked comptime, we must wrap the whole thing in a comptime block.
@@ -3525,7 +3525,7 @@ fn assignDestructureMaybeDecls(
35253525
35263526 const full = tree.assignDestructure(node);
35273527 if (full.comptime_token != null and gz.is_comptime) {
3528- try astgen.appendErrorNode(node , "redundant comptime keyword in already comptime scope", .{});
3528+ try astgen.appendErrorTok(full.comptime_token.? , "redundant comptime keyword in already comptime scope", .{});
35293529 }
35303530
35313531 const is_comptime = full.comptime_token != null or gz.is_comptime;
0 commit comments