KT-1254 "Implement members" gives strange result when implementing a method returning function type
#KT-1254 fixed
This commit is contained in:
@@ -162,7 +162,7 @@ public abstract class OverrideImplementMethodsHandler implements LanguageCodeIns
|
|||||||
final JetStandardLibrary stdlib = JetStandardLibrary.getInstance();
|
final JetStandardLibrary stdlib = JetStandardLibrary.getInstance();
|
||||||
|
|
||||||
if (returnType != null && !stdlib.getTuple0Type().equals(returnType)) {
|
if (returnType != null && !stdlib.getTuple0Type().equals(returnType)) {
|
||||||
bodyBuilder.append(" : ").append(returnType.toString());
|
bodyBuilder.append(" : ").append(DescriptorRenderer.COMPACT.renderTypeWithShortNames(returnType));
|
||||||
ImportInsertHelper.addImportDirectiveIfNeeded(returnType, file);
|
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");
|
myFixture.setTestDataPath(PluginTestCaseBase.getTestDataPathBase() + "/codeInsight/overrideImplement");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testFunctionMethod() {
|
||||||
|
doFileTest();
|
||||||
|
}
|
||||||
|
|
||||||
public void testFunctionProperty() {
|
public void testFunctionProperty() {
|
||||||
doFileTest();
|
doFileTest();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user