| ... | @@ -2117,10 +2117,10 @@ fn comptimeExprAst( | ... | @@ -2117,10 +2117,10 @@ fn comptimeExprAst( |
| 2117 | node: Ast.Node.Index, | 2117 | node: Ast.Node.Index, |
| 2118 | ) InnerError!Zir.Inst.Ref { | 2118 | ) InnerError!Zir.Inst.Ref { |
| 2119 | const astgen = gz.astgen; | 2119 | const astgen = gz.astgen; |
| | 2120 | const tree = astgen.tree; |
| 2120 | if (gz.is_comptime) { | 2121 | 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", .{}); |
| 2122 | } | 2123 | } |
| 2123 | const tree = astgen.tree; | | |
| 2124 | const body_node = tree.nodeData(node).node; | 2124 | const body_node = tree.nodeData(node).node; |
| 2125 | return comptimeExpr2(gz, scope, ri, body_node, node, .comptime_keyword); | 2125 | return comptimeExpr2(gz, scope, ri, body_node, node, .comptime_keyword); |
| 2126 | } | 2126 | } |
| ... | @@ -3469,7 +3469,7 @@ fn assignDestructure(gz: *GenZir, scope: *Scope, node: Ast.Node.Index) InnerErro | ... | @@ -3469,7 +3469,7 @@ fn assignDestructure(gz: *GenZir, scope: *Scope, node: Ast.Node.Index) InnerErro |
| 3469 | | 3469 | |
| 3470 | const full = tree.assignDestructure(node); | 3470 | const full = tree.assignDestructure(node); |
| 3471 | if (full.comptime_token != null and gz.is_comptime) { | 3471 | 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", .{}); |
| 3473 | } | 3473 | } |
| 3474 | | 3474 | |
| 3475 | // If this expression is marked comptime, we must wrap the whole thing in a comptime block. | 3475 | // If this expression is marked comptime, we must wrap the whole thing in a comptime block. |
| ... | @@ -3525,7 +3525,7 @@ fn assignDestructureMaybeDecls( | ... | @@ -3525,7 +3525,7 @@ fn assignDestructureMaybeDecls( |
| 3525 | | 3525 | |
| 3526 | const full = tree.assignDestructure(node); | 3526 | const full = tree.assignDestructure(node); |
| 3527 | if (full.comptime_token != null and gz.is_comptime) { | 3527 | 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", .{}); |
| 3529 | } | 3529 | } |
| 3530 | | 3530 | |
| 3531 | const is_comptime = full.comptime_token != null or gz.is_comptime; | 3531 | const is_comptime = full.comptime_token != null or gz.is_comptime; |