diff options
| author | Ginger Bill <bill@gingerbill.org> | 2017-01-19 19:02:44 +0000 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2017-01-19 19:02:44 +0000 |
| commit | 563b1e2b285e788338aecfa9f3d6536fb9516fd0 (patch) | |
| tree | 8ea1f852f89ee765da94dab334b9a2efbec31cdc /src/check_decl.c | |
| parent | 4603d2525ebdfa57522ec60db4a86cbc99251ee5 (diff) | |
`immutable` field prefix
Diffstat (limited to 'src/check_decl.c')
| -rw-r--r-- | src/check_decl.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/check_decl.c b/src/check_decl.c index dc7c6e120..5b6d9d230 100644 --- a/src/check_decl.c +++ b/src/check_decl.c @@ -538,6 +538,7 @@ void check_proc_body(Checker *c, Token token, DeclInfo *decl, Type *type, AstNod if (!(e->flags & EntityFlag_Anonymous)) { continue; } + bool is_immutable = e->Variable.is_immutable; String name = e->token.string; Type *t = base_type(type_deref(e->type)); if (is_type_struct(t) || is_type_raw_union(t)) { @@ -547,6 +548,7 @@ void check_proc_body(Checker *c, Token token, DeclInfo *decl, Type *type, AstNod Entity *f = (*found)->elements.entries.e[i].value; if (f->kind == Entity_Variable) { Entity *uvar = make_entity_using_variable(c->allocator, e, f->token, f->type); + uvar->Variable.is_immutable = is_immutable; Entity *prev = scope_insert_entity(c->context.scope, uvar); if (prev != NULL) { error(e->token, "Namespace collision while `using` `%.*s` of: %.*s", LIT(name), LIT(prev->token.string)); |