Files
Tagir Valeev 9ff09939f1 [java-highlighting] fixes after recent changes in highlighting
Part of IDEA-365344 Create a new Java error highlighter with minimal dependencies (PSI only)

GitOrigin-RevId: 5fbcd6d223a0ea3c04bc0d219cff125938470816
2025-01-31 15:31:12 +00:00

26 lines
563 B
Java

class Test {
public static void main(String[] args) {
Box<String> stringBox = new Box<String>("123");
stringBox.transform(new <error descr="Class 'Anonymous class derived from Fn' must implement abstract method 'apply(A)' in 'Fn'">Fn<String,<error descr="Identifier expected"> </error>></error>() {});
}
static class Box<T> {
T value;
Box(T value) {
this.value = value;
}
public <O> Box<O> transform(Fn<T, O> fn) {
return new Box<O>(fn.apply(value));
}
}
interface Fn<A, B> {
B apply(A value);
}
}