JavaCompilerCore/resources/bytecode/javFiles/Switch.jav

17 lines
425 B
Java

import java.lang.Integer;
import java.lang.Object;
import java.lang.Float;
public record Rec(Integer a, Object b) {}
public class Switch {
public main(o) {
return switch (o) {
case Rec(Integer a, Integer b) -> a + b;
case Rec(Integer a, Float b) -> a + 10;
case Rec(Integer a, Rec(Integer b, Integer c)) -> a + b + c;
case Integer i -> i;
default -> 0;
};
}
}