Files
JavaCompilerCore/resources/bytecode/javFiles/PatternMatchingJava.jav
Daniel Holle 9117a608c8
Some checks failed
SonarQube Scan / SonarQube Trigger (push) Failing after 1m16s
Fix up some stuff
2026-01-15 18:16:49 +01:00

19 lines
512 B
Java

import java.lang.Object;
import List;
import Cons;
import Empty;
import Tuple;
public class PatternMatchingJava {
public zip(a, b) {
switch (a) {
case Cons(x, Cons xs) -> {
switch (b) {
case Cons(y, Cons ys) -> { return new Cons<>(new Tuple<>(x, y), zip(xs, ys)); }
case Cons(y, Empty()) -> { return new Empty<>(); }
};
}
case Cons(x, Empty()) -> { return new Empty<>(); }
};
}
}