Skip to content

Commit f0fd5de

Browse files
committed
Fix toIRType for Chars, Bytes and Shorts.
They were all erroneously translated to `jstpe.IntType`.
1 parent 8397caf commit f0fd5de

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

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

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,16 +258,24 @@ object JSEncoding {
258258
if (sym.asClass.isPrimitiveValueClass) {
259259
if (sym == defn.BooleanClass)
260260
jstpe.BooleanType
261+
else if (sym == defn.CharClass)
262+
jstpe.CharType
263+
else if (sym == defn.ByteClass)
264+
jstpe.ByteType
265+
else if (sym == defn.ShortClass)
266+
jstpe.ShortType
267+
else if (sym == defn.IntClass)
268+
jstpe.IntType
269+
else if (sym == defn.LongClass)
270+
jstpe.LongType
261271
else if (sym == defn.FloatClass)
262272
jstpe.FloatType
263273
else if (sym == defn.DoubleClass)
264274
jstpe.DoubleType
265-
else if (sym == defn.LongClass)
266-
jstpe.LongType
267275
else if (sym == defn.UnitClass)
268276
jstpe.NoType
269277
else
270-
jstpe.IntType
278+
throw new AssertionError(s"unknown primitive value class $sym")
271279
} else {
272280
if (sym == defn.ObjectClass || isJSType(sym))
273281
jstpe.AnyType

0 commit comments

Comments
 (0)