Skip to content

Commit 4c80fc6

Browse files
committed
Perform cast only when types are un-equal
1 parent 110d772 commit 4c80fc6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/lpython/semantics/python_ast_to_asr.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,9 @@ namespace CastingUtil {
164164
}
165165
cast_kind = type_rules.at(cast_key);
166166
}
167+
if( ASRUtils::check_equal_type(src, dest, true) ) {
168+
return expr;
169+
}
167170
// TODO: Fix loc
168171
return ASRUtils::EXPR(ASRUtils::make_Cast_t_value(al, loc, expr,
169172
cast_kind, dest));

0 commit comments

Comments
 (0)