functional expressions: allow to delete/change signature of default methods of functional interfaces

This commit is contained in:
Anna Kozlova
2014-04-08 12:18:32 +02:00
parent c213495147
commit d8ed05dbfa
8 changed files with 70 additions and 9 deletions
@@ -0,0 +1,12 @@
interface SAM {
default void <caret>foo(){}
void bar();
}
class Test {
{
bar(() -> {});
}
void bar(SAM sam){}
}
@@ -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) -> {};
}
}
@@ -0,0 +1,11 @@
interface SAM {
void bar(int i);
}
class Test {
{
SAM sam = (i) -> {};
}
}
@@ -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");
}