harec

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit db13800de14785bd52b9bed9d665817113e1d0af
parent cf8784d820bc8b8b97fc1a6eee4e93d37c512833
Author: Armin Weigl <tb46305@gmail.com>
Date:   Tue, 23 Feb 2021 19:13:50 +0100

fix enum access for namespace import

Diffstat:
Msrc/check.c | 9+++++++++
1 file changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/check.c b/src/check.c @@ -2585,6 +2585,10 @@ load_import(struct ast_imports *import, scope_insert(scope, obj->otype, &obj->ident, &obj->name, obj->type, obj->value); if (obj->name.ns && obj->name.ns->ns) { + struct identifier ns2 = { + .name = NULL, + .ns = NULL, + }; struct identifier ns = { .name = obj->name.ns->name, .ns = NULL @@ -2593,6 +2597,11 @@ load_import(struct ast_imports *import, .name = obj->name.name, .ns = &ns, }; + if (type_dealias(obj->type)->storage == STORAGE_ENUM + && obj->otype == O_CONST) { + ns2.name = obj->name.ns->ns->name; + ns.ns = &ns2; + }; scope_insert(scope, obj->otype, &obj->ident, &name, obj->type, obj->value); }