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
import static java.util.stream.IntStream.rangeClosed;
public interface X {
static String fizzbuzz(int i) {
return switch((Integer) i) {
case Integer v when v % 15 == 0 -> "FizzBuzz";
case Integer v when v % 5 == 0 -> "Buzz";
case Integer v when v % 3 == 0 -> "Fizz";
case Integer v -> "" + v;
};
}
static void main(String[] args) {
rangeClosed(1, 100).mapToObj(i -> fizzbuzz(i)).forEach(System.out::println);
}
}
Carried over from bugzilla.
For this code:
We generate the following bytecode:
The three instances of
checkcast #9
are redundantThe text was updated successfully, but these errors were encountered: