diff options
| author | Daniel Gavin <danielgavin5@hotmail.com> | 2021-04-27 00:06:30 +0200 |
|---|---|---|
| committer | Daniel Gavin <danielgavin5@hotmail.com> | 2021-04-27 00:06:30 +0200 |
| commit | 51b198aa569b4df3cf93716eaeb216348e60d5ba (patch) | |
| tree | a15361c1199f178f918219ec9b718b3459172433 /src/check_decl.cpp | |
| parent | 87bfd3166482eaa3d89387bde03852f23c6f0629 (diff) | |
| parent | 94fd59e6f0e509f823edd3c90130841510cceb70 (diff) | |
Merge remote-tracking branch 'upstream/master' into prototype-fmt
Diffstat (limited to 'src/check_decl.cpp')
| -rw-r--r-- | src/check_decl.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/check_decl.cpp b/src/check_decl.cpp index 85c58fdf9..f008317ad 100644 --- a/src/check_decl.cpp +++ b/src/check_decl.cpp @@ -359,7 +359,7 @@ void override_entity_in_scope(Entity *original_entity, Entity *new_entity) { } if (original_entity->identifier != nullptr && original_entity->identifier->kind == Ast_Ident) { - original_entity->identifier->Ident.entity = new_entity; + original_entity->identifier->Ident.entity = nullptr; } original_entity->flags |= EntityFlag_Overridden; @@ -460,14 +460,14 @@ void check_const_decl(CheckerContext *ctx, Entity *e, Ast *type_expr, Ast *init, case Entity_LibraryName: case Entity_ImportName: { - override_entity_in_scope(e, entity); - DeclInfo *decl = decl_info_of_entity(e); if (decl != nullptr) { if (decl->attributes.count > 0) { error(decl->attributes[0], "Constant alias declarations cannot have attributes"); } } + + override_entity_in_scope(e, entity); return; } } |