method refs: take qualifier's type arguments in account: raw types

This commit is contained in:
anna
2012-09-28 10:11:45 +02:00
parent 2cdfea8b61
commit b130fcba63
2 changed files with 17 additions and 1 deletions
@@ -591,7 +591,9 @@ public class LambdaUtil {
if (signatureParameterTypes1.length != signatureParameterTypes2.length) {
if (signatureParameterTypes1.length == signatureParameterTypes2.length + 1) {
final PsiClassType classType = JavaPsiFacade.getElementFactory(psiClass.getProject()).createType(psiClass, psiSubstitutor);
if (signatureParameterTypes1[0].equals(classType)) {
final PsiType receiverType = signatureParameterTypes1[0];
if (receiverType.equals(classType) ||
(receiverType instanceof PsiClassType && ((PsiClassType)receiverType).isRaw() && receiverType.equals(TypeConversionUtil.erasure(classType)))) {
offset++;
}
else {
@@ -14,3 +14,17 @@ class MyTest {
}
}
}
class MyTest1 {
interface I {
String m(Foo f);
}
static class Foo<X> {
String foo() { return null; }
static void test() {
I i = Foo::foo;
}
}
}