Skip to content

Commit b510150

Browse files
committed
Fix a compiler warning
1 parent ece6c73 commit b510150

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

src/lpython/semantics/python_comptime_eval.h

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -391,21 +391,20 @@ struct PythonIntrinsicProcedures {
391391
return arg;
392392
} else if (ASRUtils::is_character(*type)) {
393393
ASR::ttype_t *list_type = ASRUtils::TYPE(ASR::make_List_t(al, loc, str_type));
394-
if (ASRUtils::expr_value(arg) != nullptr) {
395-
std::string c = ASR::down_cast<ASR::StringConstant_t>(arg)->m_s;
396-
Vec<ASR::expr_t*> list;
397-
list.reserve(al, c.length());
398-
std::string r;
399-
for (size_t i=0; i<c.length(); i++) {
400-
r.push_back(char(c[i]));
401-
list.push_back(al, ASR::down_cast<ASR::expr_t>(
402-
ASR::make_StringConstant_t(al, loc, s2c(al, r),
403-
str_type)));
404-
r.pop_back();
405-
}
406-
return ASR::down_cast<ASR::expr_t>(ASR::make_ListConstant_t(al, loc, list.p,
407-
list.size(), list_type));
394+
LFORTRAN_ASSERT(ASRUtils::expr_value(arg) != nullptr)
395+
std::string c = ASR::down_cast<ASR::StringConstant_t>(arg)->m_s;
396+
Vec<ASR::expr_t*> list;
397+
list.reserve(al, c.length());
398+
std::string r;
399+
for (size_t i=0; i<c.length(); i++) {
400+
r.push_back(char(c[i]));
401+
list.push_back(al, ASR::down_cast<ASR::expr_t>(
402+
ASR::make_StringConstant_t(al, loc, s2c(al, r),
403+
str_type)));
404+
r.pop_back();
408405
}
406+
return ASR::down_cast<ASR::expr_t>(ASR::make_ListConstant_t(al, loc, list.p,
407+
list.size(), list_type));
409408
} else {
410409
throw SemanticError("'" + ASRUtils::type_to_str_python(type) +
411410
"' object conversion to List is not implemented ",

0 commit comments

Comments
 (0)