| ... | @@ -3676,7 +3676,7 @@ ZigVar *add_variable(CodeGen *g, AstNode *source_node, Scope *parent_scope, Buf | ... | @@ -3676,7 +3676,7 @@ ZigVar *add_variable(CodeGen *g, AstNode *source_node, Scope *parent_scope, Buf |
| 3676 | } | 3676 | } |
| 3677 | if (search_scope != nullptr) { | 3677 | if (search_scope != nullptr) { |
| 3678 | Tld *tld = find_decl(g, search_scope, name); | 3678 | Tld *tld = find_decl(g, search_scope, name); |
| 3679 | if (tld != nullptr) { | 3679 | if (tld != nullptr && tld != src_tld) { |
| 3680 | ErrorMsg *msg = add_node_error(g, source_node, | 3680 | ErrorMsg *msg = add_node_error(g, source_node, |
| 3681 | buf_sprintf("redefinition of '%s'", buf_ptr(name))); | 3681 | buf_sprintf("redefinition of '%s'", buf_ptr(name))); |
| 3682 | add_error_note(g, msg, tld->source_node, buf_sprintf("previous definition is here")); | 3682 | add_error_note(g, msg, tld->source_node, buf_sprintf("previous definition is here")); |