-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: Port integration_tests/arrays_31.f90
, arrays_34.f90
and arrays_35.f90
from LFortran and improve LC to compile it
#112
base: main
Are you sure you want to change the base?
Conversation
Aah I forgot to update references, will do it. |
|
||
[[test]] | ||
filename = "../integration_tests/array_28.cpp" | ||
asr = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[[test]] | |
filename = "../integration_tests/array_28.cpp" | |
asr = true | |
# TODO: Remove after integration_tests/array_28.cpp compiles with LC | |
[[test]] | |
filename = "../integration_tests/array_28.cpp" | |
asr = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reference testing should be as limited as possible.
@@ -146,6 +146,14 @@ namespace LCompilers::CastingUtil { | |||
} else { | |||
dest = ASRUtils::extract_type(dest); | |||
} | |||
if (ASR::is_a<ASR::ArrayConstant_t>(*expr)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think casting should be done only on the basis of type
. Using expression to decide casting operation seems more like a hard-coded approach.
arr->m_args[i] = ASRUtils::expr_value(ASRUtils::EXPR(ASRUtils::make_Cast_t_value(al, loc, arr->m_args[i], | ||
cast_kind, ASRUtils::expr_type(arr->m_args[i])))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems we are casting each array element to the type of that same array element. So, why is a casting being needed?
Thanks for the reviews @Shaikh-Ubaid. I had similar questions but these changes felt harmless to me for now. |
No description provided.