File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -893,7 +893,8 @@ namespace LCompilers {
893893 if ( comp == -1 ) {
894894 int increment;
895895 bool not_constant_inc = false ;
896- if (!ASRUtils::is_integer (*ASRUtils::expr_type (c))) {
896+ if (!ASRUtils::is_integer (*ASRUtils::type_get_past_const (
897+ ASRUtils::expr_type (c)))) {
897898 throw LCompilersException (" Do loop increment type should be an integer" );
898899 }
899900 if (c->type == ASR::exprType::IntegerConstant) {
Original file line number Diff line number Diff line change @@ -5301,7 +5301,8 @@ class BodyVisitor : public CommonVisitor<BodyVisitor> {
53015301 head.m_start = loop_start;
53025302 head.m_increment = inc;
53035303
5304- if ( !ASR::is_a<ASR::Integer_t>(*ASRUtils::expr_type (inc)) ) {
5304+ if ( !ASR::is_a<ASR::Integer_t>(*ASRUtils::type_get_past_const (
5305+ ASRUtils::expr_type (inc))) ) {
53055306 throw SemanticError (" For loop increment type should be Integer." , loc);
53065307 }
53075308 ASR::expr_t *inc_value = ASRUtils::expr_value (inc);
You can’t perform that action at this time.
0 commit comments