mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-02 19:28:23 +07:00
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
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user