From 2c196581158a11387fa3612135733ceaacae1f5b Mon Sep 17 00:00:00 2001 From: Krzosa Karol Date: Sat, 1 Apr 2023 12:22:45 +0200 Subject: [PATCH] Skip resolution of polymorphs --- core_compiler.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/core_compiler.cpp b/core_compiler.cpp index 9d42cc1..f3d9463 100644 --- a/core_compiler.cpp +++ b/core_compiler.cpp @@ -289,13 +289,12 @@ resolve_everything_in_module(Ast_Module *module) { pctx->time.typechecking = os_time(); For_Named(module->all_loaded_files, file) { For_Named(file->decls, decl) { + bool is_polymorph = decl->flags & AST_POLYMORPH; + if (is_polymorph) continue; + resolve_name(file, decl->pos, decl->name); - bool is_agg = decl->kind == AST_STRUCT || decl->kind == AST_UNION; - bool is_polymorph = decl->flags & AST_POLYMORPH; - if (is_agg && !is_polymorph) { - type_complete(decl->type_val); - } + if (decl->kind == AST_STRUCT || decl->kind == AST_UNION) type_complete(decl->type_val); } } module->state = MODULE_RESOLVED;