JavaCompilerCore/resources/bytecode/javFiles/SwitchOverload.jav

17 lines
316 B
Plaintext
Raw Normal View History

2024-10-01 15:28:20 +00:00
import java.lang.Integer;
import java.lang.Double;
import java.lang.Number;
public record R(Number n) {}
public class SwitchOverload {
Number f(Double d) { return d * 2; }
Number f(Integer i) { return i * 5; }
public m(r) {
return switch(r) {
case R(o) -> f(o);
};
}
}