-
Sub-task
-
Resolution: Delivered
-
P4
-
22
Prior to JDK 22, the `javac` compiler was accepting private method references with a type variable receiver. This implies that the `javac` compiler was accepting code like:
```
import java.util.function.*;
class Test {
private String asString() {
return "bar";
}
static <T extends Test> Function<T, String> foo() {
return T::asString;
}
}
```
Starting from JDK 22 private method references with type variable receiver will be rejected by the `javac` compiler.
```
import java.util.function.*;
class Test {
private String asString() {
return "bar";
}
static <T extends Test> Function<T, String> foo() {
return T::asString;
}
}
```
Starting from JDK 22 private method references with type variable receiver will be rejected by the `javac` compiler.