From 9f52b2c2834a3a7248784492a3ede3a8a9063f6a Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sun, 3 Dec 2017 22:28:54 +0000 Subject: Update demo.odin --- src/check_decl.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/check_decl.cpp') 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)); -- cgit v1.2.3