File tree 1 file changed +6
-3
lines changed 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -3764,7 +3764,7 @@ class SymbolTableVisitor : public CommonVisitor<SymbolTableVisitor> {
3764
3764
if (x.m_args .m_args [i].m_annotation == nullptr ) {
3765
3765
throw SemanticError (" Argument does not have a type" , loc);
3766
3766
}
3767
- ASR::intentType s_intent = ASRUtils::intent_in ;
3767
+ ASR::intentType s_intent = ASRUtils::intent_unspecified ;
3768
3768
AST::expr_t * arg_annotation_type = get_var_intent_and_annotation (x.m_args .m_args [i].m_annotation , s_intent);
3769
3769
ASR::ttype_t *arg_type = ast_expr_to_asr_type (x.base .base .loc , *arg_annotation_type);
3770
3770
// Set the function as generic if an argument is typed with a type parameter
@@ -3793,8 +3793,11 @@ class SymbolTableVisitor : public CommonVisitor<SymbolTableVisitor> {
3793
3793
std::string arg_s = arg;
3794
3794
ASR::expr_t *value = nullptr ;
3795
3795
ASR::expr_t *init_expr = nullptr ;
3796
- if (ASRUtils::is_array (arg_type)) {
3797
- s_intent = ASRUtils::intent_inout;
3796
+ if (s_intent == ASRUtils::intent_unspecified) {
3797
+ s_intent = ASRUtils::intent_in;
3798
+ if (ASRUtils::is_array (arg_type)) {
3799
+ s_intent = ASRUtils::intent_inout;
3800
+ }
3798
3801
}
3799
3802
ASR::storage_typeType storage_type =
3800
3803
ASR::storage_typeType::Default;
You can’t perform that action at this time.
0 commit comments