TL;DR: scalac apparently doesn't believe in exhaustiveness of value set (true
, false
) for a boolean, so pattern matching on a boolean in Scala emits a branch for "neither true nor false". (I won't even go into it emitting comparison to 1 and 0 instead of using ifeq
or ifne
instructions, or those goto
s that jump to the very next instruction.)
This scala code:
final class X {
final def foo(b: Boolean) =
b match {
case true => 10
case false => 11
}