mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-07 22:09:38 +07:00
testdata for IDEA-130547
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
import java.util.function.Function;
|
||||
abstract class List<T> {
|
||||
private final T head;
|
||||
private final List<T> tail;
|
||||
|
||||
protected List() {
|
||||
this.head = null;
|
||||
this.tail = null;
|
||||
}
|
||||
|
||||
private List(T head, List<T> tail) {
|
||||
this.head = head;
|
||||
this.tail = tail;
|
||||
}
|
||||
|
||||
protected T getHead() {
|
||||
return head;
|
||||
}
|
||||
private static <T> RecCall<Result<T>> firstHelper(final List<T> list, final Function<T, Boolean> f) {
|
||||
return cont(new RecCall.Continue<Result<T>>(firstHelper(list.tail, f)));
|
||||
}
|
||||
|
||||
public static <T> RecCall<T> cont(final RecCall<T> next) {
|
||||
return new RecCall.Continue<T>(next);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
interface Result<B> {}
|
||||
|
||||
interface RecCall<T> {
|
||||
public static class Continue<T> implements RecCall<T> {
|
||||
private final RecCall<T> next;
|
||||
|
||||
public Continue(RecCall<T> next) {
|
||||
this.next = next;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user