functional interfaces: ignore methods with type parameters during abstract method choosing

This commit is contained in:
Anna Kozlova
2014-04-22 20:02:38 +02:00
parent a55db18089
commit f1f6fcf53b
3 changed files with 19 additions and 1 deletions
@@ -181,7 +181,8 @@ public class LambdaUtil {
boolean subsignature = true;
for (MethodSignature methodSignature : signatures) {
if (!signature.equals(methodSignature)) {
if (!MethodSignatureUtil.isSubsignature(signature, methodSignature)) {
if (!MethodSignatureUtil.isSubsignature(signature, methodSignature) &&
methodSignature.getTypeParameters().length == 0) {
subsignature = false;
break;
}
@@ -0,0 +1,16 @@
class Test {
interface A {
<X> void m();
}
interface B {
void m();
}
interface C extends A, B { }
{
C c = ()-> {};
}
}
@@ -103,6 +103,7 @@ public class LambdaHighlightingTest extends LightDaemonAnalyzerTestCase {
public void testIDEA123308() {doTest();}
public void testIntersection() {doTest();}
public void testNoBoxingInLambdaFormalParams() {doTest();}
public void testGenericNotGenericInterfaceMethod() {doTest();}
private void doTest() {
doTest(false);