@@ -891,7 +891,7 @@ class CommonVisitor : public AST::BaseVisitor<StructType> {
891
891
} else if (var_annotation == " str" ) {
892
892
type = ASRUtils::TYPE (ASR::make_String_t (al, loc, 1 ,
893
893
ASRUtils::EXPR (ASR::make_IntegerConstant_t (al, loc, -2 ,
894
- ASRUtils::TYPE (ASR::make_Integer_t (al, loc, 4 )))),
894
+ ASRUtils::TYPE (ASR::make_Integer_t (al, loc, 8 )))),
895
895
false , false , ASR::string_physical_typeType::PointerString));
896
896
type = ASRUtils::make_Array_t_util (al, loc, type, dims.p , dims.size (), abi, is_argument);
897
897
} else if (var_annotation == " bool" || var_annotation == " i1" ) {
@@ -1952,7 +1952,7 @@ class CommonVisitor : public AST::BaseVisitor<StructType> {
1952
1952
AST::ConstantStr_t *n = AST::down_cast<AST::ConstantStr_t>(&annotation);
1953
1953
ASR::symbol_t *sym = current_scope->resolve_symbol (n->m_value );
1954
1954
if ( sym == nullptr || !ASR::is_a<ASR::Struct_t>(*sym) ) {
1955
- throw SemanticError (" Only StructType implemented for con "
1955
+ throw SemanticError (" Only StructType implemented for constant "
1956
1956
" str annotation" , loc);
1957
1957
}
1958
1958
// TODO: Change the returned type from Class to StructType
@@ -8158,7 +8158,7 @@ we will have to use something else.
8158
8158
ASR::expr_t * a_len = ASRUtils::EXPR (ASR::make_IntegerConstant_t (al,
8159
8159
loc, s_var.size (), ASRUtils::TYPE (ASR::make_Integer_t (al, loc, 8 ))));
8160
8160
ASR::ttype_t *str_type = ASRUtils::TYPE (ASR::make_String_t (al, loc,
8161
- 1 , a_len, false , false , ASR::string_physical_typeType::PointerString));
8161
+ - 1 , a_len, false , false , ASR::string_physical_typeType::PointerString));
8162
8162
tmp = ASR::make_StringConstant_t (al, loc, s2c (al, s_var), str_type);
8163
8163
}
8164
8164
@@ -8589,10 +8589,8 @@ we will have to use something else.
8589
8589
}
8590
8590
}
8591
8591
}
8592
- ASR::expr_t * a_len = ASRUtils::EXPR (ASR::make_IntegerConstant_t (al, x.base .base .loc ,
8593
- 0 , ASRUtils::TYPE (ASR::make_Integer_t (al, x.base .base .loc , 8 ))));
8594
8592
ASR::ttype_t *type = ASRUtils::TYPE (ASR::make_String_t (
8595
- al, x.base .base .loc , - 1 , a_len , false , false , ASR::string_physical_typeType::PointerString ));
8593
+ al, x.base .base .loc , 1 , nullptr , false , false , ASR::string_physical_typeType::CString ));
8596
8594
ASR::expr_t * string_format = ASRUtils::EXPR (ASRUtils::make_StringFormat_t_util (al, x.base .base .loc ,
8597
8595
nullptr , args_expr.p , args_expr.size (), ASR::string_format_kindType::FormatPythonFormat,
8598
8596
type, nullptr ));
0 commit comments