Skip to content

Commit 98c0f84

Browse files
committed
fix typos and rebase
1 parent e0884b3 commit 98c0f84

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

src/lpython/semantics/python_ast_to_asr.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1847,15 +1847,17 @@ class BodyVisitor : public CommonVisitor<BodyVisitor> {
18471847
}
18481848
if (ASR::is_a<ASR::Variable_t>(*t)) {
18491849
ASR::Variable_t *var = ASR::down_cast<ASR::Variable_t>(t);
1850-
// LFORTRAN_ASSERT(var->m_value);
18511850
if (ASRUtils::is_complex(*var->m_type)) {
18521851
std::string attr = x.m_attr;
18531852
if (attr == "imag") {
18541853
ASR::expr_t *val = ASR::down_cast<ASR::expr_t>(ASR::make_Var_t(al, x.base.base.loc, t));
18551854
ASR::symbol_t *fn_imag = resolve_intrinsic_function(x.base.base.loc, "imag");
1856-
Vec<ASR::expr_t*> args;
1855+
Vec<ASR::call_arg_t> args;
18571856
args.reserve(al, 1);
1858-
args.push_back(al, val);
1857+
ASR::call_arg_t arg;
1858+
arg.loc = val->base.loc;
1859+
arg.m_value = val;
1860+
args.push_back(al, arg);
18591861
make_call_helper(al, fn_imag, current_scope, args, "imag", x.base.base.loc);
18601862
return;
18611863
} else if (attr == "real") {

src/lpython/semantics/python_comptime_eval.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ struct PythonIntrinsicProcedures {
509509
double result = im;
510510
return ASR::down_cast<ASR::expr_t>(ASR::make_ConstantReal_t(al, loc, result, t));
511511
} else {
512-
throw SemanticError("Argument of the aimag() function must be Complex", loc);
512+
throw SemanticError("Argument of the imag() function must be Complex", loc);
513513
}
514514
}
515515

src/runtime/lpython_builtin.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,3 +296,4 @@ def imag(x: c64) -> f64:
296296

297297
@overload
298298
def imag(x: c32) -> f32:
299+
pass

0 commit comments

Comments
 (0)