You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For switch-Matches in PatMap, convert scrutinee and alternatives to Int.
In JVM bytecode as well in Scala.js IR, switches only work with
primitive ints. Therefore, it makes more sense to convert the
scrutinee and alternatives of switch-Matches to Ints early.
This is also what scalac does. See `RegularSwitchMaker` in
`patmat/MatchOptimization.scala`.
The JVM back-end tolerates non-ints due its aggressive and blind
adaptations everywhere (not because of a deliberate action to
support non-Ints). However, the Scala.js back-end does not like
receiving non-Ints in `Match`es, because it is much more
conservative in where it inserts adaptations (i.e., almost
nowhere).
0 commit comments