KT-1254 "Implement members" gives strange result when implementing a method returning function type

#KT-1254 fixed
This commit is contained in:
Nikolay Krasko
2012-03-28 21:34:22 +04:00
parent befe3246cc
commit 77652a9df8
4 changed files with 24 additions and 1 deletions
@@ -162,7 +162,7 @@ public abstract class OverrideImplementMethodsHandler implements LanguageCodeIns
final JetStandardLibrary stdlib = JetStandardLibrary.getInstance();
if (returnType != null && !stdlib.getTuple0Type().equals(returnType)) {
bodyBuilder.append(" : ").append(returnType.toString());
bodyBuilder.append(" : ").append(DescriptorRenderer.COMPACT.renderTypeWithShortNames(returnType));
ImportInsertHelper.addImportDirectiveIfNeeded(returnType, file);
}
@@ -0,0 +1,8 @@
// From KT-1254
trait T {
fun Foo() : (String) -> Unit
}
class C : T {
<caret>
}
@@ -0,0 +1,11 @@
// From KT-1254
trait T {
fun Foo() : (String) -> Unit
}
class C : T {
override fun Foo() : (String) -> Unit {
throw UnsupportedOperationException()
}
}
@@ -49,6 +49,10 @@ public class OverrideImplementTest extends LightCodeInsightFixtureTestCase {
myFixture.setTestDataPath(PluginTestCaseBase.getTestDataPathBase() + "/codeInsight/overrideImplement");
}
public void testFunctionMethod() {
doFileTest();
}
public void testFunctionProperty() {
doFileTest();
}