mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
functional interfaces: ignore methods with type parameters during abstract method choosing
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
class Test {
|
||||
|
||||
interface A {
|
||||
<X> void m();
|
||||
}
|
||||
|
||||
interface B {
|
||||
void m();
|
||||
}
|
||||
|
||||
interface C extends A, B { }
|
||||
|
||||
{
|
||||
C c = ()-> {};
|
||||
}
|
||||
}
|
||||
+1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user