mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
method refs: do not loose information about type arguments given by ReferenceType in receiver
This commit is contained in:
+4
@@ -196,6 +196,10 @@ public class PsiMethodReferenceCompatibilityConstraint implements ConstraintForm
|
||||
PsiType qualifierType;
|
||||
if (qualifierTypeElement != null) {
|
||||
qualifierType = qualifierTypeElement.getType();
|
||||
final PsiClass qualifierClass = PsiUtil.resolveClassInType(qualifierType);
|
||||
if (qualifierClass != null) {
|
||||
qualifierType = JavaPsiFacade.getElementFactory(myExpression.getProject()).createType(qualifierClass, PsiSubstitutor.EMPTY);
|
||||
}
|
||||
}
|
||||
else {
|
||||
LOG.assertTrue(qualifierExpression != null);
|
||||
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
class Box<T>
|
||||
{
|
||||
public T getValue()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
void f(Stream<Box<String>> stream) {
|
||||
List<String> l3 = stream
|
||||
.map(Box<String>::getValue)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
+4
@@ -233,6 +233,10 @@ public class NewMethodRefHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testFromReferenceWithTypeArgs() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
private void doTest() {
|
||||
doTest(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user