diff --git a/ets2panda/checker/ets/helpers.cpp b/ets2panda/checker/ets/helpers.cpp index 5e11b6fe85bcd2bd0d6a3a5efd8020b9a5f2240a..53f6bead293c1a7956cdcf2f8bdf808747c780d6 100644 --- a/ets2panda/checker/ets/helpers.cpp +++ b/ets2panda/checker/ets/helpers.cpp @@ -683,6 +683,10 @@ std::tuple ETSChecker::ApplyBinaryOperatorPromotion(Type *left, Ty return {GlobalLongType(), both_const}; } + if (unboxed_l->IsCharType() && unboxed_r->IsCharType()) { + return {GlobalCharType(), both_const}; + } + return {GlobalIntType(), both_const}; } diff --git a/ets2panda/compiler/core/ETSGen.h b/ets2panda/compiler/core/ETSGen.h index 95aaa9528a2c0680881104be8bcdf62c2d3eee06..3fd4295604ea969d508346e823678da1c313b1b0 100644 --- a/ets2panda/compiler/core/ETSGen.h +++ b/ets2panda/compiler/core/ETSGen.h @@ -836,6 +836,7 @@ private: case checker::TypeFlag::ETS_BOOLEAN: case checker::TypeFlag::BYTE: case checker::TypeFlag::SHORT: + case checker::TypeFlag::CHAR: case checker::TypeFlag::INT: { Ra().Emit(node, lhs, if_false); break;