diff --git a/src/libasr/asr_scopes.cpp b/src/libasr/asr_scopes.cpp index 4fae6739e8..a50e471c60 100644 --- a/src/libasr/asr_scopes.cpp +++ b/src/libasr/asr_scopes.cpp @@ -39,9 +39,14 @@ void SymbolTable::mark_all_variables_external(Allocator &al) { case (ASR::symbolType::Function) : { ASR::Function_t *v = ASR::down_cast(a.second); ASR::FunctionType_t* v_func_type = ASR::down_cast(v->m_function_signature); + if ((v_func_type->m_abi != ASR::abiType::Intrinsic) && + (v_func_type->m_abi != ASR::abiType::Interactive)) { + v->m_dependencies = nullptr; + v->n_dependencies = 0; + v->m_body = nullptr; + v->n_body = 0; + } v_func_type->m_abi = ASR::abiType::Interactive; - v->m_body = nullptr; - v->n_body = 0; break; } case (ASR::symbolType::Module) : { diff --git a/src/libasr/asr_verify.cpp b/src/libasr/asr_verify.cpp index 62ab9180c6..16b255f8cc 100644 --- a/src/libasr/asr_verify.cpp +++ b/src/libasr/asr_verify.cpp @@ -420,14 +420,6 @@ class VerifyVisitor : public BaseWalkVisitor } void visit_Function(const Function_t &x) { - ASR::FunctionType_t* v_func_type = ASR::down_cast(x.m_function_signature); - if (v_func_type->m_abi == abiType::Interactive) { - require(x.n_body == 0, - "The Function::n_body should be 0 if abi set to Interactive"); - require(x.m_body == nullptr, - "The Function::m_body should be null if abi set to Interactive"); - return; - } std::vector function_dependencies_copy = function_dependencies; function_dependencies.clear(); function_dependencies.reserve(x.n_dependencies);