JavaCompilerCore/resources/bytecode/javFiles/SwitchInfered.jav
Ruben 0d572ed9b6
Some checks failed
Build and Test with Maven / Build-and-test-with-Maven (push) Failing after 6m20s
feat: changes in Grammar and Parser so typeless Recs get recognised
2024-06-06 12:16:28 +02:00

17 lines
416 B
Java

import java.lang.Integer;
import java.lang.Object;
import java.lang.Float;
public record Rec(Integer a, Object b) {}
public class SwitchInfered {
public main(o) {
return switch (o) {
case Rec(a, 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;
};
}
}