From 35f423cbefedfaad5671e44ab2187f01fdc8d994 Mon Sep 17 00:00:00 2001 From: Gergo Torok Date: Fri, 3 Mar 2023 12:29:20 +0100 Subject: [PATCH] Fixing the binary numeric promotion of conditional expression Signed-off-by: Gergo Torok --- ir/expressions/conditionalExpression.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/ir/expressions/conditionalExpression.cpp b/ir/expressions/conditionalExpression.cpp index f32ed731d..200462902 100644 --- a/ir/expressions/conditionalExpression.cpp +++ b/ir/expressions/conditionalExpression.cpp @@ -148,16 +148,7 @@ checker::Type *ConditionalExpression::NumericConditionalCheck(checker::ETSChecke if (consequentType->IsLongType() || alternateType->IsLongType()) { return checker->GlobalLongType(); } - if (consequentType->IsIntType() || alternateType->IsIntType()) { - return checker->GlobalIntType(); - } - if (consequentType->IsShortType() || alternateType->IsShortType()) { - return checker->GlobalShortType(); - } - if (consequentType->IsByteType() || alternateType->IsByteType()) { - return checker->GlobalByteType(); - } - UNREACHABLE(); + return checker->GlobalIntType(); } } // namespace panda::es2panda::ir -- Gitee