Skip to content

Commit 906a55f

Browse files
committed
Fix JS code gen for Byte, Short and Char literals.
They were all erroneously translated to `IntLiteral`s.
1 parent b534eb2 commit 906a55f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

compiler/src/dotty/tools/backend/sjs/JSCodeGen.scala

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -936,7 +936,13 @@ class JSCodeGen()(implicit ctx: Context) {
936936
js.Skip()
937937
case BooleanTag =>
938938
js.BooleanLiteral(value.booleanValue)
939-
case ByteTag | ShortTag | CharTag | IntTag =>
939+
case ByteTag =>
940+
js.ByteLiteral(value.byteValue)
941+
case ShortTag =>
942+
js.ShortLiteral(value.shortValue)
943+
case CharTag =>
944+
js.CharLiteral(value.charValue)
945+
case IntTag =>
940946
js.IntLiteral(value.intValue)
941947
case LongTag =>
942948
js.LongLiteral(value.longValue)

0 commit comments

Comments
 (0)