Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newMethodRef/RegisterVariablesForNonFoundParameterizations.java
Anna.Kozlova 74f6d68ea3 inference for method references: register new variables for raw access
IDEA-189883, IDEA-188976: according to the 15.13.1 search for member is performed in the parameterization (non-raw) type which is a subtype of the first parameter type, in this case no additional variables are required as the type contains type arguments
2018-04-11 10:19:16 +02:00

28 lines
441 B
Java

import java.util.stream.Stream;
import java.util.Optional;
class SomeClass<T> {
private T id;
public T getId() {
return id;
}
public void n(final Optional<SomeClass<T>> o) {
T otherId = o.map(SomeClass::getId).orElse(null);
}
}
class A {
interface Base<T> {
T foo();
}
interface Sub<S> extends Base<S> { }
void m(Stream<Sub> stream) {
stream.map( Sub::foo);
}
}