diff options
| author | LemonBoy <thatlemon@gmail.com> | 2019-09-26 17:54:45 +0200 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-09-26 13:39:09 -0400 |
| commit | 2c8864f634cbb42bf45f4f6b7109e9129b357247 (patch) | |
| tree | ba98972c0178252fdb8f5790bc17606f834c37c2 /src | |
| parent | b89a09af4bb0064bb3d37acef4c9c1d4ee1515a6 (diff) | |
| download | zig-2c8864f634cbb42bf45f4f6b7109e9129b357247.tar.gz zig-2c8864f634cbb42bf45f4f6b7109e9129b357247.zip | |
Don't warn about redeclaration for the same var node
Closes #3316
Diffstat (limited to 'src')
| -rw-r--r-- | src/analyze.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp index 5a3551a7c2..bdb007a68a 100644 --- a/src/analyze.cpp +++ b/src/analyze.cpp @@ -3676,7 +3676,7 @@ ZigVar *add_variable(CodeGen *g, AstNode *source_node, Scope *parent_scope, Buf } if (search_scope != nullptr) { Tld *tld = find_decl(g, search_scope, name); - if (tld != nullptr) { + if (tld != nullptr && tld != src_tld) { ErrorMsg *msg = add_node_error(g, source_node, buf_sprintf("redefinition of '%s'", buf_ptr(name))); add_error_note(g, msg, tld->source_node, buf_sprintf("previous definition is here")); |
