KT-1985 Add test case and fix minor bug
Reference compacting must be done before adding body to class.
This commit is contained in:
@@ -87,11 +87,12 @@ public abstract class OverrideImplementMethodsHandler implements LanguageCodeIns
|
||||
afterAnchor = added;
|
||||
elementsToCompact.add((JetElement) added);
|
||||
}
|
||||
ReferenceToClassesShortening.compactReferenceToClasses(elementsToCompact);
|
||||
|
||||
if (!body.isPhysical()) {
|
||||
classOrObject.add(JetPsiFactory.createWhiteSpace(project));
|
||||
classOrObject.add(body);
|
||||
}
|
||||
ReferenceToClassesShortening.compactReferenceToClasses(elementsToCompact);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
// From KT-1254
|
||||
trait T {
|
||||
fun Foo() : (String) -> Unit
|
||||
}
|
||||
|
||||
class C : <caret>T
|
||||
@@ -0,0 +1,10 @@
|
||||
// From KT-1254
|
||||
trait T {
|
||||
fun Foo() : (String) -> Unit
|
||||
}
|
||||
|
||||
class C : T {
|
||||
override fun Foo(): (String) -> Unit {
|
||||
throw UnsupportedOperationException()
|
||||
}
|
||||
}
|
||||
@@ -54,6 +54,10 @@ public class OverrideImplementTest extends LightCodeInsightFixtureTestCase {
|
||||
myFixture.setTestDataPath(PluginTestCaseBase.getTestDataPathBase() + "/codeInsight/overrideImplement");
|
||||
}
|
||||
|
||||
public void testEmptyClassBodyFunctionMethod() {
|
||||
doImplementFileTest();
|
||||
}
|
||||
|
||||
public void testFunctionMethod() {
|
||||
doImplementFileTest();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user