| ... | ... | @@ -6372,11 +6372,9 @@ fn identifier( |
| 6372 | 6372 | |
| 6373 | 6373 | if (local_val.name == name_str_index) { |
| 6374 | 6374 | local_val.used = true; |
| 6375 | | // Captures of non-locals need to be emitted as decl_val or decl_ref. |
| 6376 | | // This *might* be capturable depending on if it is comptime known. |
| 6377 | | if (hit_namespace == 0) { |
| 6378 | | return rvalue(gz, rl, local_val.inst, ident); |
| 6379 | | } |
| 6375 | // Locals cannot shadow anything, so we do not need to look for ambiguous |
| 6376 | // references in this case. |
| 6377 | return rvalue(gz, rl, local_val.inst, ident); |
| 6380 | 6378 | } |
| 6381 | 6379 | s = local_val.parent; |
| 6382 | 6380 | }, |
| ... | ... | @@ -6384,14 +6382,11 @@ fn identifier( |
| 6384 | 6382 | const local_ptr = s.cast(Scope.LocalPtr).?; |
| 6385 | 6383 | if (local_ptr.name == name_str_index) { |
| 6386 | 6384 | local_ptr.used = true; |
| 6387 | | if (hit_namespace != 0) { |
| 6388 | | if (local_ptr.maybe_comptime) |
| 6389 | | break |
| 6390 | | else |
| 6391 | | return astgen.failNodeNotes(ident, "mutable '{s}' not accessible from here", .{ident_name}, &.{ |
| 6392 | | try astgen.errNoteTok(local_ptr.token_src, "declared mutable here", .{}), |
| 6393 | | try astgen.errNoteNode(hit_namespace, "crosses namespace boundary here", .{}), |
| 6394 | | }); |
| 6385 | if (hit_namespace != 0 and !local_ptr.maybe_comptime) { |
| 6386 | return astgen.failNodeNotes(ident, "mutable '{s}' not accessible from here", .{ident_name}, &.{ |
| 6387 | try astgen.errNoteTok(local_ptr.token_src, "declared mutable here", .{}), |
| 6388 | try astgen.errNoteNode(hit_namespace, "crosses namespace boundary here", .{}), |
| 6389 | }); |
| 6395 | 6390 | } |
| 6396 | 6391 | switch (rl) { |
| 6397 | 6392 | .ref, .none_or_ref => return local_ptr.ptr, |