File tree 2 files changed +5
-4
lines changed
2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -805,7 +805,7 @@ RUN(NAME test_statistics_01 LABELS cpython llvm llvm_jit NOFAST)
805
805
RUN(NAME test_attributes LABELS cpython llvm llvm_jit)
806
806
# RUN(NAME test_str_attributes LABELS cpython llvm llvm_jit c)
807
807
RUN(NAME kwargs_01 LABELS cpython llvm llvm_jit NOFAST) # renable c
808
- # RUN(NAME def_func_01 LABELS cpython llvm llvm_jit c)
808
+ RUN(NAME def_func_01 LABELS cpython llvm llvm_jit) # renable c
809
809
810
810
RUN(NAME func_inline_01 LABELS llvm llvm_jit c wasm)
811
811
RUN(NAME func_inline_02 LABELS cpython llvm llvm_jit c)
Original file line number Diff line number Diff line change @@ -1178,7 +1178,7 @@ class CommonVisitor : public AST::BaseVisitor<StructType> {
1178
1178
size_t missed_args_count =0 ;
1179
1179
for (size_t def_arg = args.size (); def_arg < func->n_args ; def_arg++){
1180
1180
ASR::Variable_t* var = ASRUtils::EXPR2VAR (func->m_args [def_arg]);
1181
- if (var->m_symbolic_value == nullptr ) {
1181
+ if (var->m_presence != ASR::presenceType::Optional ) {
1182
1182
missed_args_names+= " '" + std::string (var->m_name ) + " ' and " ;
1183
1183
missed_args_count++;
1184
1184
} else {
@@ -4570,7 +4570,8 @@ class SymbolTableVisitor : public CommonVisitor<SymbolTableVisitor> {
4570
4570
std::string arg_s = arg;
4571
4571
ASR::expr_t *value = nullptr ;
4572
4572
ASR::expr_t *init_expr = nullptr ;
4573
- if (i >= default_arg_index_start){
4573
+ bool is_optional_arg = i>=default_arg_index_start;
4574
+ if (is_optional_arg){
4574
4575
size_t default_arg_index = i - default_arg_index_start;
4575
4576
this ->visit_expr (*(x.m_args .m_defaults [default_arg_index]));
4576
4577
init_expr = ASRUtils::EXPR (tmp);
@@ -4593,7 +4594,7 @@ class SymbolTableVisitor : public CommonVisitor<SymbolTableVisitor> {
4593
4594
}
4594
4595
ASR::accessType s_access = ASR::accessType::Public;
4595
4596
ASR::presenceType s_presence = ASR::presenceType::Required;
4596
- if (i >= default_arg_index_start ){
4597
+ if (is_optional_arg ){
4597
4598
s_presence = ASR::presenceType::Optional;
4598
4599
}
4599
4600
bool value_attr = false ;
You can’t perform that action at this time.
0 commit comments