Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Implemented ASR checks for function dependencies #2167

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
049fbc6
fix: check dependencies are from same symbol table
arteevraina Jul 16, 2023
fc86d98
fix: remove print statement
arteevraina Jul 16, 2023
42d5146
fix: update verify logic
arteevraina Jul 17, 2023
4805b69
fix: update logic for verification of dependencies
arteevraina Jul 18, 2023
71bee66
refactor: remove cout
arteevraina Jul 18, 2023
70f2f9c
fix: get the parent symtab of x
arteevraina Jul 18, 2023
a2e802b
fix: skip the symbols which are nullptr or of type External Symbol
arteevraina Jul 18, 2023
8d8bbc7
fix: update cmakelists
arteevraina Jul 19, 2023
c1116e3
fix: check while adding dependencies to make sure they are from same …
arteevraina Jul 26, 2023
b531009
fix: asr verify passes for callback_01 test
arteevraina Aug 11, 2023
2c436ba
fix: tests relating to external symbols and function dependencies
arteevraina Aug 12, 2023
6fc8a6d
fix: condition for checking intrinsic function
arteevraina Aug 15, 2023
f1d77ae
Allow global scope dependencies as well
certik Aug 18, 2023
f94840f
Merge main
czgdp1807 Aug 25, 2023
47d0f5d
Robust check for making sure that dependency isn't defined inside the…
czgdp1807 Aug 25, 2023
456071b
fix: add robust checking using resolve symbol when symbol is nested
arteevraina Aug 26, 2023
ca26122
fix: improved check by checking only in parent scopes and not in curr…
arteevraina Aug 26, 2023
dd2d3ab
fix: improved checks for dependencies in asr verify
arteevraina Aug 27, 2023
681514f
Check if external symbol is not nested inside the current_scope
czgdp1807 Aug 28, 2023
433d944
fix: applied correct checks in ast to asr
arteevraina Aug 28, 2023
14632b4
refactor: added function to check for current scope in asr utils
arteevraina Aug 28, 2023
0491339
refactor: remove unused function
arteevraina Aug 28, 2023
d943c5a
updated references
arteevraina Aug 28, 2023
f97063f
Merge branch 'main' into checks-for-same-symtab-dependencies
arteevraina Aug 28, 2023
b1d00d4
remove nofast
arteevraina Aug 28, 2023
c1c8bd2
Merge branch 'main' into checks-for-same-symtab-dependencies
arteevraina Aug 29, 2023
f1e1c2f
refactor: function call & subroutine call dependencies
arteevraina Sep 2, 2023
261c187
feat: sync libasr
arteevraina Oct 4, 2023
6f7c8fa
fix: update branch
arteevraina Oct 4, 2023
ccaa3ec
dev: udpate branch
arteevraina Oct 4, 2023
f68f71a
fix: updated all references
arteevraina Oct 4, 2023
0c7e8b5
dev: sync libasr with lfortran
arteevraina Oct 18, 2023
74e4251
test: update references
arteevraina Oct 18, 2023
1801bb5
tests: update references
arteevraina Oct 18, 2023
895f411
fix: set asr_owner when visiting For
arteevraina Oct 24, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions src/libasr/asr_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,9 @@ bool use_overloaded(ASR::expr_t* left, ASR::expr_t* right,
}
}
}
current_function_dependencies.push_back(al, s2c(al, matched_func_name));
if (ASRUtils::symbol_parent_symtab(a_name)->get_counter() != curr_scope->get_counter()) {
ADD_ASR_DEPENDENCIES_WITH_NAME(curr_scope, a_name, current_function_dependencies, s2c(al, matched_func_name));
}
ASRUtils::insert_module_dependency(a_name, al, current_module_dependencies);
ASRUtils::set_absent_optional_arguments_to_null(a_args, func, al);
asr = ASRUtils::make_FunctionCall_t_util(al, loc, a_name, sym,
Expand Down Expand Up @@ -699,7 +701,9 @@ void process_overloaded_unary_minus_function(ASR::symbol_t* proc, ASR::expr_t* o
}
}
}
current_function_dependencies.push_back(al, s2c(al, matched_func_name));
if (ASRUtils::symbol_parent_symtab(a_name)->get_counter() != curr_scope->get_counter()) {
ADD_ASR_DEPENDENCIES_WITH_NAME(curr_scope, a_name, current_function_dependencies, s2c(al, matched_func_name));
}
ASRUtils::insert_module_dependency(a_name, al, current_module_dependencies);
ASRUtils::set_absent_optional_arguments_to_null(a_args, func, al);
asr = ASRUtils::make_FunctionCall_t_util(al, loc, a_name, proc,
Expand Down Expand Up @@ -870,7 +874,9 @@ void process_overloaded_assignment_function(ASR::symbol_t* proc, ASR::expr_t* ta
if( a_name == nullptr ) {
err("Unable to resolve matched subroutine for assignment overloading, " + matched_subrout_name, loc);
}
current_function_dependencies.push_back(al, s2c(al, matched_subrout_name));
if (ASRUtils::symbol_parent_symtab(a_name)->get_counter() != curr_scope->get_counter()) {
ADD_ASR_DEPENDENCIES_WITH_NAME(curr_scope, a_name, current_function_dependencies, s2c(al, matched_subrout_name));
}
ASRUtils::insert_module_dependency(a_name, al, current_module_dependencies);
ASRUtils::set_absent_optional_arguments_to_null(a_args, subrout, al);
asr = ASRUtils::make_SubroutineCall_t_util(al, loc, a_name, sym,
Expand Down Expand Up @@ -1010,7 +1016,9 @@ bool use_overloaded(ASR::expr_t* left, ASR::expr_t* right,
} else {
return_type = ASRUtils::expr_type(func->m_return_var);
}
current_function_dependencies.push_back(al, s2c(al, matched_func_name));
if (ASRUtils::symbol_parent_symtab(a_name)->get_counter() != curr_scope->get_counter()) {
ADD_ASR_DEPENDENCIES_WITH_NAME(curr_scope, a_name, current_function_dependencies, s2c(al, matched_func_name));
}
ASRUtils::insert_module_dependency(a_name, al, current_module_dependencies);
ASRUtils::set_absent_optional_arguments_to_null(a_args, func, al);
asr = ASRUtils::make_FunctionCall_t_util(al, loc, a_name, sym,
Expand Down
37 changes: 36 additions & 1 deletion src/libasr/asr_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,28 @@

#include <complex>

#define ADD_ASR_DEPENDENCIES(current_scope, final_sym, current_function_dependencies) ASR::symbol_t* asr_owner_sym = nullptr; \
if(current_scope->asr_owner && ASR::is_a<ASR::symbol_t>(*current_scope->asr_owner) ) { \
asr_owner_sym = ASR::down_cast<ASR::symbol_t>(current_scope->asr_owner); \
} \
SymbolTable* temp_scope = current_scope; \
if (asr_owner_sym && temp_scope->get_counter() != ASRUtils::symbol_parent_symtab(final_sym)->get_counter() && \
!ASR::is_a<ASR::AssociateBlock_t>(*asr_owner_sym) && !ASR::is_a<ASR::ExternalSymbol_t>(*final_sym) && \
!ASR::is_a<ASR::Variable_t>(*final_sym)) { \
current_function_dependencies.push_back(al, ASRUtils::symbol_name(final_sym)); \
} \

#define ADD_ASR_DEPENDENCIES_WITH_NAME(current_scope, final_sym, current_function_dependencies, dep_name) ASR::symbol_t* asr_owner_sym = nullptr; \
if(current_scope->asr_owner && ASR::is_a<ASR::symbol_t>(*current_scope->asr_owner) ) { \
asr_owner_sym = ASR::down_cast<ASR::symbol_t>(current_scope->asr_owner); \
} \
SymbolTable* temp_scope = current_scope; \
if (asr_owner_sym && temp_scope->get_counter() != ASRUtils::symbol_parent_symtab(final_sym)->get_counter() && \
!ASR::is_a<ASR::AssociateBlock_t>(*asr_owner_sym) && !ASR::is_a<ASR::ExternalSymbol_t>(*final_sym) && \
!ASR::is_a<ASR::Variable_t>(*final_sym)) { \
current_function_dependencies.push_back(al, dep_name); \
} \

namespace LCompilers {

namespace ASRUtils {
Expand Down Expand Up @@ -554,6 +576,17 @@ static inline std::pair<char**, size_t> symbol_dependencies(const ASR::symbol_t
}
}

static inline bool is_present_in_current_scope(ASR::ExternalSymbol_t* external_symbol, SymbolTable* current_scope) {
SymbolTable* scope = external_symbol->m_parent_symtab;
while (scope != nullptr) {
if (scope->get_counter() == current_scope->get_counter()) {
return true;
}
scope = scope->parent;
}
return false;
}

static inline SymbolTable *symbol_parent_symtab(const ASR::symbol_t *f)
{
switch (f->type) {
Expand Down Expand Up @@ -3189,7 +3222,9 @@ class ReplaceArgVisitor: public ASR::BaseExprReplacer<ReplaceArgVisitor> {
default:
break;
}
current_function_dependencies.push_back(al, ASRUtils::symbol_name(new_es));
if (ASRUtils::symbol_parent_symtab(new_es)->get_counter() != current_scope->get_counter()) {
ADD_ASR_DEPENDENCIES(current_scope, new_es, current_function_dependencies);
}
ASRUtils::insert_module_dependency(new_es, al, current_module_dependencies);
x->m_name = new_es;
}
Expand Down
42 changes: 40 additions & 2 deletions src/libasr/asr_verify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,20 @@ class VerifyVisitor : public BaseWalkVisitor<VerifyVisitor>
verify_unique_dependencies(x.m_dependencies, x.n_dependencies,
x.m_name, x.base.base.loc);

// Get the x symtab.
SymbolTable *x_symtab = x.m_symtab;

// Dependencies of the function should be from function's parent symbol table.
for( size_t i = 0; i < x.n_dependencies; i++ ) {
std::string found_dep = x.m_dependencies[i];

// Get the symbol of the found_dep.
ASR::symbol_t* dep_sym = x_symtab->resolve_symbol(found_dep);

require(dep_sym != nullptr,
"Dependency " + found_dep + " is inside symbol table " + std::string(x.m_name));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be "Dependency " + found_dep + " is not* inside symbol table "

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correct, "not inside".

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you both are right.

I assumed the resolve_symbol checks in parent scope only and not in the current_scope. Now that i checked it's documentation, it checks both in current & parent scopes.

The check should will be updated like this :
SymbolTable *x_parent_symtab = x.m_symtab->parent; instead of SymbolTable* x_symtab = x.m_symtab;
and then "inside" phrase will make sense here.

}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am trying to understand the logic here.

Are we ensuring that all dependencies are from the same parent symbol table?

It seems this logic is testing that all the symbols (except ExternalSymbol) are NOT from the parent symbol table. Tests pass, so I guess this is the correct logic, but I don't understand it. Once I understand it, let's document this as a comment.


// Check if there are unnecessary dependencies
// present in the dependency list of the function
for( size_t i = 0; i < x.n_dependencies; i++ ) {
Expand Down Expand Up @@ -870,7 +884,19 @@ class VerifyVisitor : public BaseWalkVisitor<VerifyVisitor>
}
}

function_dependencies.push_back(std::string(ASRUtils::symbol_name(x.m_name)));
ASR::symbol_t* asr_owner_sym = nullptr;
if(current_symtab->asr_owner && ASR::is_a<ASR::symbol_t>(*current_symtab->asr_owner) ) {
asr_owner_sym = ASR::down_cast<ASR::symbol_t>(current_symtab->asr_owner);
}

SymbolTable* temp_scope = current_symtab;

if (temp_scope->get_counter() != ASRUtils::symbol_parent_symtab(x.m_name)->get_counter() &&
!ASR::is_a<ASR::AssociateBlock_t>(*asr_owner_sym) && !ASR::is_a<ASR::ExternalSymbol_t>(*x.m_name) &&
!ASR::is_a<ASR::Variable_t>(*x.m_name)) {
function_dependencies.push_back(std::string(ASRUtils::symbol_name(x.m_name)));
}

if( ASR::is_a<ASR::ExternalSymbol_t>(*x.m_name) ) {
ASR::ExternalSymbol_t* x_m_name = ASR::down_cast<ASR::ExternalSymbol_t>(x.m_name);
if( x_m_name->m_external && ASR::is_a<ASR::Module_t>(*ASRUtils::get_asr_owner(x_m_name->m_external)) ) {
Expand Down Expand Up @@ -1003,7 +1029,19 @@ class VerifyVisitor : public BaseWalkVisitor<VerifyVisitor>
void visit_FunctionCall(const FunctionCall_t &x) {
require(x.m_name,
"FunctionCall::m_name must be present");
function_dependencies.push_back(std::string(ASRUtils::symbol_name(x.m_name)));
ASR::symbol_t* asr_owner_sym = nullptr;
if(current_symtab->asr_owner && ASR::is_a<ASR::symbol_t>(*current_symtab->asr_owner) ) {
asr_owner_sym = ASR::down_cast<ASR::symbol_t>(current_symtab->asr_owner);
}

SymbolTable* temp_scope = current_symtab;

if (asr_owner_sym && temp_scope->get_counter() != ASRUtils::symbol_parent_symtab(x.m_name)->get_counter() &&
!ASR::is_a<ASR::AssociateBlock_t>(*asr_owner_sym) && !ASR::is_a<ASR::ExternalSymbol_t>(*x.m_name) &&
!ASR::is_a<ASR::Variable_t>(*x.m_name)) {
function_dependencies.push_back(std::string(ASRUtils::symbol_name(x.m_name)));
}

if( ASR::is_a<ASR::ExternalSymbol_t>(*x.m_name) ) {
ASR::ExternalSymbol_t* x_m_name = ASR::down_cast<ASR::ExternalSymbol_t>(x.m_name);
if( x_m_name->m_external && ASR::is_a<ASR::Module_t>(*ASRUtils::get_asr_owner(x_m_name->m_external)) ) {
Expand Down
18 changes: 9 additions & 9 deletions src/libasr/pass/instantiate_template.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,6 @@ class SymbolInstantiator : public ASR::BaseExprStmtDuplicator<SymbolInstantiator
return new_x;
}



ASR::asr_t* duplicate_Var(ASR::Var_t *x) {
std::string sym_name = ASRUtils::symbol_name(x->m_v);
ASR::symbol_t* sym = duplicate_symbol(x->m_v);
Expand Down Expand Up @@ -430,9 +428,9 @@ class SymbolInstantiator : public ASR::BaseExprStmtDuplicator<SymbolInstantiator
throw LCompilersException("Cannot handle instantiation for the function call " + call_name);
}
}

dependencies.push_back(al, ASRUtils::symbol_name(name));

if (ASRUtils::symbol_parent_symtab(name)->get_counter() != current_scope->get_counter()) {
ADD_ASR_DEPENDENCIES(current_scope, name, dependencies);
}
return ASRUtils::make_FunctionCall_t_util(al, x->base.base.loc, name, x->m_original_name,
args.p, args.size(), type, value, dt);
}
Expand Down Expand Up @@ -474,10 +472,10 @@ class SymbolInstantiator : public ASR::BaseExprStmtDuplicator<SymbolInstantiator
throw LCompilersException("Cannot handle instantiation for the function call " + call_name);
}
}

dependencies.push_back(al, ASRUtils::symbol_name(name));

return ASRUtils::make_SubroutineCall_t_util(al, x->base.base.loc, name,
if (ASRUtils::symbol_parent_symtab(name)->get_counter() != current_scope->get_counter()) {
ADD_ASR_DEPENDENCIES(current_scope, name, dependencies);
}
return ASRUtils::make_SubroutineCall_t_util(al, x->base.base.loc, name /* change this */,
x->m_original_name, args.p, args.size(), dt, nullptr, false);
}

Expand Down Expand Up @@ -651,6 +649,8 @@ void check_restriction(std::map<std::string, ASR::ttype_t*> type_subs,
{f->m_args[i]->base.loc}),
diag::Label("Function's parameter " + avar + " of type " + atype,
{arg->m_args[i]->base.loc})


}
));
throw SemanticAbort();
Expand Down
61 changes: 57 additions & 4 deletions src/libasr/pass/pass_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ namespace LCompilers {
bool fill_function_dependencies;
bool fill_module_dependencies;
bool fill_variable_dependencies;
SymbolTable* current_scope;

public:

Expand All @@ -273,10 +274,13 @@ namespace LCompilers {
function_dependencies.n = 0;
module_dependencies.n = 0;
variable_dependencies.n = 0;
current_scope = nullptr;
}

void visit_Function(const ASR::Function_t& x) {
ASR::Function_t& xx = const_cast<ASR::Function_t&>(x);
SymbolTable* current_scope_copy = current_scope;
current_scope = xx.m_symtab;
SetChar function_dependencies_copy;
function_dependencies_copy.from_pointer_n_copy(al, function_dependencies.p, function_dependencies.size());
function_dependencies.n = 0;
Expand All @@ -291,6 +295,7 @@ namespace LCompilers {
function_dependencies_copy.p,
function_dependencies_copy.size()
);
current_scope = current_scope_copy;
}

void visit_Module(const ASR::Module_t& x) {
Expand Down Expand Up @@ -327,9 +332,21 @@ namespace LCompilers {
}

void visit_FunctionCall(const ASR::FunctionCall_t& x) {
if( fill_function_dependencies ) {
function_dependencies.push_back(al, ASRUtils::symbol_name(x.m_name));
if (fill_function_dependencies) {
ASR::symbol_t* asr_owner_sym = nullptr;
if (current_scope->asr_owner && ASR::is_a<ASR::symbol_t>(*current_scope->asr_owner)) {
asr_owner_sym = ASR::down_cast<ASR::symbol_t>(current_scope->asr_owner);
}

SymbolTable* temp_scope = current_scope;

if (asr_owner_sym && temp_scope->get_counter() != ASRUtils::symbol_parent_symtab(x.m_name)->get_counter() &&
!ASR::is_a<ASR::AssociateBlock_t>(*asr_owner_sym) && !ASR::is_a<ASR::ExternalSymbol_t>(*x.m_name) &&
!ASR::is_a<ASR::Variable_t>(*x.m_name)) {
function_dependencies.push_back(al, ASRUtils::symbol_name(x.m_name));
}
}

if( ASR::is_a<ASR::ExternalSymbol_t>(*x.m_name) &&
fill_module_dependencies ) {
ASR::ExternalSymbol_t* x_m_name = ASR::down_cast<ASR::ExternalSymbol_t>(x.m_name);
Expand All @@ -341,9 +358,21 @@ namespace LCompilers {
}

void visit_SubroutineCall(const ASR::SubroutineCall_t& x) {
if( fill_function_dependencies ) {
function_dependencies.push_back(al, ASRUtils::symbol_name(x.m_name));
if (fill_function_dependencies) {
ASR::symbol_t* asr_owner_sym = nullptr;
if (current_scope->asr_owner && ASR::is_a<ASR::symbol_t>(*current_scope->asr_owner)) {
asr_owner_sym = ASR::down_cast<ASR::symbol_t>(current_scope->asr_owner);
}

SymbolTable* temp_scope = current_scope;

if (asr_owner_sym && temp_scope->get_counter() != ASRUtils::symbol_parent_symtab(x.m_name)->get_counter() &&
!ASR::is_a<ASR::AssociateBlock_t>(*asr_owner_sym) && !ASR::is_a<ASR::ExternalSymbol_t>(*x.m_name) &&
!ASR::is_a<ASR::Variable_t>(*x.m_name)) {
function_dependencies.push_back(al, ASRUtils::symbol_name(x.m_name));
}
}

if( ASR::is_a<ASR::ExternalSymbol_t>(*x.m_name) &&
fill_module_dependencies ) {
ASR::ExternalSymbol_t* x_m_name = ASR::down_cast<ASR::ExternalSymbol_t>(x.m_name);
Expand All @@ -360,6 +389,30 @@ namespace LCompilers {
visit_stmt(*(block->m_body[i]));
}
}

void visit_AssociateBlock(const ASR::AssociateBlock_t& x) {
SymbolTable *parent_symtab = current_scope;
current_scope = x.m_symtab;
for (auto &a : x.m_symtab->get_scope()) {
this->visit_symbol(*a.second);
}
for (size_t i=0; i<x.n_body; i++) {
visit_stmt(*x.m_body[i]);
}
current_scope = parent_symtab;
}

void visit_Block(const ASR::Block_t& x) {
SymbolTable *parent_symtab = current_scope;
current_scope = x.m_symtab;
for (auto &a : x.m_symtab->get_scope()) {
this->visit_symbol(*a.second);
}
for (size_t i=0; i<x.n_body; i++) {
visit_stmt(*x.m_body[i]);
}
current_scope = parent_symtab;
}
};

namespace ReplacerUtils {
Expand Down
18 changes: 15 additions & 3 deletions src/lpython/semantics/python_ast_to_asr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1187,15 +1187,23 @@ class CommonVisitor : public AST::BaseVisitor<Struct> {
args_new.reserve(al, func->n_args);
visit_expr_list_with_cast(func->m_args, func->n_args, args_new, args,
!ASRUtils::is_intrinsic_function2(func));
dependencies.push_back(al, ASRUtils::symbol_name(stemp));

if (ASRUtils::symbol_parent_symtab(stemp)->get_counter() != current_scope->get_counter()) {
ADD_ASR_DEPENDENCIES(current_scope, stemp, dependencies);
}

return ASRUtils::make_FunctionCall_t_util(al, loc, stemp,
s_generic, args_new.p, args_new.size(),
a_type, value, nullptr);
} else {
Vec<ASR::call_arg_t> args_new;
args_new.reserve(al, func->n_args);
visit_expr_list_with_cast(func->m_args, func->n_args, args_new, args);
dependencies.push_back(al, ASRUtils::symbol_name(stemp));

if (ASRUtils::symbol_parent_symtab(stemp)->get_counter() != current_scope->get_counter()) {
ADD_ASR_DEPENDENCIES(current_scope, stemp, dependencies);
}

return ASRUtils::make_SubroutineCall_t_util(al, loc, stemp,
s_generic, args_new.p, args_new.size(), nullptr, nullptr, false);
}
Expand Down Expand Up @@ -1457,7 +1465,10 @@ class CommonVisitor : public AST::BaseVisitor<Struct> {
target_scope, target_scope, new_f, f);
}
dependencies.erase(s2c(al, func_name));
dependencies.push_back(al, s2c(al, new_func_name));

if (ASRUtils::symbol_parent_symtab(sym)->get_counter() != current_scope->get_counter()) {
ADD_ASR_DEPENDENCIES_WITH_NAME(current_scope, sym, dependencies, s2c(al, new_func_name));
}
return t;
}

Expand Down Expand Up @@ -5471,6 +5482,7 @@ class BodyVisitor : public CommonVisitor<BodyVisitor> {

SymbolTable *parent_scope = current_scope;
current_scope = al.make_new<SymbolTable>(parent_scope);
current_scope->asr_owner = parent_scope->asr_owner;
transform_stmts(body, x.n_body, x.m_body);
int32_t total_syms = current_scope->get_scope().size();
if( total_syms > 0 ) {
Expand Down
17 changes: 17 additions & 0 deletions tests/reference/asr-array_01_decl-39cf894.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
warning: The module 'numpy' located in $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py cannot be loaded
--> tests/../integration_tests/array_01_decl.py:2:1
|
2 | from numpy import empty, int16, int32, int64, float32, float64, complex64, complex128
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ imported here

Comment on lines +1 to +6
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems there are several errors like above that got committed in this PR. Are these reference errors expected or is it a bug?

warning: The module 'lpython_builtin' located in $DIR/src/bin/../runtime/lpython_builtin.py cannot be loaded
--> $DIR/src/bin/../runtime/lpython_intrinsic_numpy.py:364:12
|
364 | return x1 % x2
| ^^^^^^^ imported here

semantic error: The symbol '_lpython_floordiv' not found in the module 'lpython_builtin'
--> $DIR/src/bin/../runtime/lpython_builtin.py:209:15
|
209 | if (n_ - (n_ // 2)*2) == 0:
| ^^^^^^^
Loading