Skip to content

Commit dde47f4

Browse files
authored
Merge pull request #2069 from Shaikh-Ubaid/asr_verify_arr_alloca
Verify: Add a check for order of Allocatable and Array
2 parents 00b8d59 + d6ac861 commit dde47f4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/libasr/asr_verify.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,6 +1036,8 @@ class VerifyVisitor : public BaseWalkVisitor<VerifyVisitor>
10361036
}
10371037

10381038
void visit_Array(const Array_t& x) {
1039+
require(!ASR::is_a<ASR::Allocatable_t>(*x.m_type),
1040+
"Allocatable cannot be inside array");
10391041
visit_ttype(*x.m_type);
10401042
require(x.n_dims != 0, "Array type cannot have 0 dimensions.")
10411043
require(!ASR::is_a<ASR::Array_t>(*x.m_type), "Array type cannot be nested.")

0 commit comments

Comments
 (0)