File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -1178,7 +1178,7 @@ class CommonVisitor : public AST::BaseVisitor<StructType> {
11781178 size_t missed_args_count =0 ;
11791179 for (size_t def_arg = args.size (); def_arg < func->n_args ; def_arg++){
11801180 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 ) {
11821182 missed_args_names+= " '" + std::string (var->m_name ) + " ' and " ;
11831183 missed_args_count++;
11841184 } else {
@@ -4570,7 +4570,8 @@ class SymbolTableVisitor : public CommonVisitor<SymbolTableVisitor> {
45704570 std::string arg_s = arg;
45714571 ASR::expr_t *value = nullptr ;
45724572 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){
45744575 size_t default_arg_index = i - default_arg_index_start;
45754576 this ->visit_expr (*(x.m_args .m_defaults [default_arg_index]));
45764577 init_expr = ASRUtils::EXPR (tmp);
@@ -4593,7 +4594,7 @@ class SymbolTableVisitor : public CommonVisitor<SymbolTableVisitor> {
45934594 }
45944595 ASR::accessType s_access = ASR::accessType::Public;
45954596 ASR::presenceType s_presence = ASR::presenceType::Required;
4596- if (i >= default_arg_index_start ){
4597+ if (is_optional_arg ){
45974598 s_presence = ASR::presenceType::Optional;
45984599 }
45994600 bool value_attr = false ;
You can’t perform that action at this time.
0 commit comments