Why does Java 12 try to convert the result of a switch to a number? : <p>I agree that this code:</p>

<pre><code>var y = switch (0) {
    case 0 -&gt; '0';
    case 1 -&gt; 0.0F;
    case 2 -&gt; 2L;
    case 3 -&gt; true;
    default -&gt; 4;
};
System.out.println(y);
System.out.println(((Object) y).getClass().getName());
</code></pre>

<p>returns this:</p>

<pre><code>0
java.lang.Character
</code></pre>

<p>But if you remove boolean:</p>

<pre><code>var y = switch (0) {
    case 0 -&gt; '0';
    case 1 -&gt; 0.0F;
    case 2 -&gt; 2L;
    default -&gt; 4;
};
System.out.println(y);
System.out.println(((Object) y).getClass().getName());
</code></pre>

<p>returns this:</p>

<pre><code>48.0
java.lang.Float
</code></pre>

<p>I suppose this result is unexpected.</p>
