diff options
Diffstat (limited to 'src/check_decl.cpp')
| -rw-r--r-- | src/check_decl.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/check_decl.cpp b/src/check_decl.cpp index 72c8dcd0d..b7bd91183 100644 --- a/src/check_decl.cpp +++ b/src/check_decl.cpp @@ -786,6 +786,7 @@ void check_proc_body(Checker *c, Token token, DeclInfo *decl, Type *type, AstNod continue; } bool is_immutable = e->Variable.is_immutable; + bool is_value = (e->flags & EntityFlag_Value) != 0; String name = e->token.string; Type *t = base_type(type_deref(e->type)); if (t->kind == Type_Struct) { @@ -799,6 +800,8 @@ void check_proc_body(Checker *c, Token token, DeclInfo *decl, Type *type, AstNod if (f->kind == Entity_Variable) { Entity *uvar = make_entity_using_variable(c->allocator, e, f->token, f->type); uvar->Variable.is_immutable = is_immutable; + if (is_value) uvar->flags |= EntityFlag_Value; + Entity *prev = scope_insert_entity(c->context.scope, uvar); if (prev != nullptr) { error(e->token, "Namespace collision while 'using' '%.*s' of: %.*s", LIT(name), LIT(prev->token.string)); |