diff --git a/ets2panda/compiler/lowering/util.cpp b/ets2panda/compiler/lowering/util.cpp index a80338b1f7fa95ce71c241dea26f49d3913b6e95..9ed88bc6f312535114bdbec028598c832b563039 100644 --- a/ets2panda/compiler/lowering/util.cpp +++ b/ets2panda/compiler/lowering/util.cpp @@ -215,7 +215,7 @@ varbinder::Scope *Rebind(PhaseManager *phaseManager, varbinder::ETSBinder *varBi auto *scope = NearestScope(node->Parent()); auto bscope = varbinder::LexicalScope::Enter(varBinder, scope); - ClearTypesVariablesAndScopes(node); + node->IterateRecursively([](ir::AstNode *ast) -> void { ast->CleanUp(); }); InitScopesPhaseETS::RunExternalNode(node, varBinder); varBinder->ResolveReferencesForScopeWithContext(node, scope); diff --git a/ets2panda/public/es2panda_lib.cpp b/ets2panda/public/es2panda_lib.cpp index 8df91d24aff6942c01c70ef14542a277129967cd..1aaf2e9827edcdeb8d4891e282ab5cf1b01dbcd7 100644 --- a/ets2panda/public/es2panda_lib.cpp +++ b/ets2panda/public/es2panda_lib.cpp @@ -1022,6 +1022,18 @@ extern "C" void AstNodeRecheck(es2panda_Context *ctx, es2panda_AstNode *node) return; } +extern "C" void AstNodeSubtreeRecheck(es2panda_Context *ctx, es2panda_AstNode *node) +{ + auto E2pNode = reinterpret_cast(node); + auto context = reinterpret_cast(ctx); + auto varbinder = context->parserProgram->VarBinder()->AsETSBinder(); + auto checker = context->GetChecker()->AsETSChecker(); + auto phaseManager = context->phaseManager; + compiler::Recheck(phaseManager, varbinder, checker, E2pNode); + context->state = !context->diagnosticEngine->IsAnyError() ? ES2PANDA_STATE_CHECKED : ES2PANDA_STATE_ERROR; + return; +} + #include "generated/es2panda_lib/es2panda_lib_impl.inc" extern "C" Es2pandaEnum Es2pandaEnumFromString([[maybe_unused]] es2panda_Context *ctx, const char *str)