mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
functional expressions: allow to delete/change signature of default methods of functional interfaces
This commit is contained in:
+12
@@ -0,0 +1,12 @@
|
||||
interface SAM {
|
||||
default void <caret>foo(){}
|
||||
void bar();
|
||||
}
|
||||
|
||||
class Test {
|
||||
{
|
||||
bar(() -> {});
|
||||
}
|
||||
|
||||
void bar(SAM sam){}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
interface SAM {
|
||||
default void foo(boolean b){}
|
||||
void bar();
|
||||
}
|
||||
|
||||
class Test {
|
||||
{
|
||||
bar(() -> {});
|
||||
}
|
||||
|
||||
void bar(SAM sam){}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
interface SAM {
|
||||
default void fo<caret>o(int i){}
|
||||
void bar(int i);
|
||||
}
|
||||
|
||||
class Test {
|
||||
|
||||
{
|
||||
SAM sam = (i) -> {};
|
||||
}
|
||||
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
interface SAM {
|
||||
void bar(int i);
|
||||
}
|
||||
|
||||
class Test {
|
||||
|
||||
{
|
||||
SAM sam = (i) -> {};
|
||||
}
|
||||
|
||||
}
|
||||
+4
@@ -31,6 +31,10 @@ public class ChangeSignatureTouchLambdaTest extends ChangeSignatureBaseTest {
|
||||
doTestConflict();
|
||||
}
|
||||
|
||||
public void testDefaultMethodTouched() throws Exception {
|
||||
doTest(null, null, null, new ParameterInfoImpl[] {new ParameterInfoImpl(-1, "b", PsiType.BOOLEAN)}, new ThrownExceptionInfo[0], false);
|
||||
}
|
||||
|
||||
private void doTestConflict() {
|
||||
try {
|
||||
doTest(null, null, null, new ParameterInfoImpl[] {new ParameterInfoImpl(-1, "b", PsiType.BOOLEAN)}, new ThrownExceptionInfo[0], false);
|
||||
|
||||
@@ -158,6 +158,11 @@ public class SafeDeleteTest extends MultiFileTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
public void testFunctionalInterfaceDefaultMethod() throws Exception {
|
||||
LanguageLevelProjectExtension.getInstance(getProject()).setLanguageLevel(LanguageLevel.JDK_1_8);
|
||||
doSingleFileTest();
|
||||
}
|
||||
|
||||
public void testMethodDeepHierarchy() throws Exception {
|
||||
doTest("Super");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user