Skip to content

Commit 21910b4

Browse files
committed
fix: resolve the symbol and omit check if external symbol
1 parent db24052 commit 21910b4

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/libasr/asr_verify.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,10 +1090,15 @@ class VerifyVisitor : public BaseWalkVisitor<VerifyVisitor>
10901090
if( ASRUtils::get_asr_owner(x.m_derived_type) ) {
10911091
symbol_owner = ASRUtils::symbol_name(ASRUtils::get_asr_owner(x.m_derived_type));
10921092
}
1093-
// Check if x.m_derived_type is imported from another module as an external symbol.
1094-
if( !ASR::is_a<ASR::ExternalSymbol_t>(*x.m_derived_type) ) {
1093+
1094+
// Resolve the symbol in the current symbol table.
1095+
ASR::symbol_t* symbol = current_symtab->resolve_symbol(ASRUtils::symbol_name(x.m_derived_type));
1096+
1097+
// If the symbol is an ExternalSymbol, then omit the check.
1098+
if (ASR::is_a<ASR::ExternalSymbol_t>(*symbol)) {
10951099
return;
10961100
}
1101+
10971102
require(symtab_in_scope(current_symtab, x.m_derived_type),
10981103
"Struct::m_derived_type '" +
10991104
std::string(ASRUtils::symbol_name(x.m_derived_type)) +

0 commit comments

Comments
 (0)