Skip to content

Commit 5923b99

Browse files
Move global GenericProcedure into a module
1 parent b5b86f4 commit 5923b99

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/libasr/asr_scopes.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,12 @@ void SymbolTable::move_symbols_from_global_scope(Allocator &/*al*/,
182182
module_scope->add_symbol(a.first, (ASR::symbol_t *) fn);
183183
syms.push_back(a.first);
184184
break;
185+
} case (ASR::symbolType::GenericProcedure) : {
186+
ASR::GenericProcedure_t *es = ASR::down_cast<ASR::GenericProcedure_t>(a.second);
187+
es->m_parent_symtab = module_scope;
188+
module_scope->add_symbol(a.first, (ASR::symbol_t *) es);
189+
syms.push_back(a.first);
190+
break;
185191
} case (ASR::symbolType::ExternalSymbol) : {
186192
ASR::ExternalSymbol_t *es = ASR::down_cast<ASR::ExternalSymbol_t>(a.second);
187193
es->m_parent_symtab = module_scope;
@@ -201,6 +207,7 @@ void SymbolTable::move_symbols_from_global_scope(Allocator &/*al*/,
201207
syms.push_back(a.first);
202208
break;
203209
} default : {
210+
ASRUtils::print_symbol(a.second);
204211
throw LCompilersException("Moving the symbol:`" + a.first +
205212
"` from global scope is not implemented yet");
206213
};

0 commit comments

Comments
 (0)