From e390385bf96450d43c834796ecda6b97f5cb8749 Mon Sep 17 00:00:00 2001 From: "Pavel V. Talanov" Date: Tue, 15 Jul 2014 18:05:58 +0400 Subject: [PATCH] Fix shortening references for return type in MakeTypeExplicitInLambdaIntention #KT-5475 Fixed --- .../plugin/intentions/MakeTypeExplicitInLambdaIntention.kt | 2 +- .../shortenReferencesForReturnType.kt | 5 +++++ .../shortenReferencesForReturnType.kt.after | 7 +++++++ .../jet/plugin/intentions/IntentionTestGenerated.java | 5 +++++ 4 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 idea/testData/intentions/makeTypeExplicitInLambda/shortenReferencesForReturnType.kt create mode 100644 idea/testData/intentions/makeTypeExplicitInLambda/shortenReferencesForReturnType.kt.after diff --git a/idea/src/org/jetbrains/jet/plugin/intentions/MakeTypeExplicitInLambdaIntention.kt b/idea/src/org/jetbrains/jet/plugin/intentions/MakeTypeExplicitInLambdaIntention.kt index b05020e9867..737ba5bd756 100644 --- a/idea/src/org/jetbrains/jet/plugin/intentions/MakeTypeExplicitInLambdaIntention.kt +++ b/idea/src/org/jetbrains/jet/plugin/intentions/MakeTypeExplicitInLambdaIntention.kt @@ -88,9 +88,9 @@ public class MakeTypeExplicitInLambdaIntention : JetSelfTargetingIntention) { + val f = { (x: Int) -> c} +} + +// WITH_RUNTIME \ No newline at end of file diff --git a/idea/testData/intentions/makeTypeExplicitInLambda/shortenReferencesForReturnType.kt.after b/idea/testData/intentions/makeTypeExplicitInLambda/shortenReferencesForReturnType.kt.after new file mode 100644 index 00000000000..2db59b07c55 --- /dev/null +++ b/idea/testData/intentions/makeTypeExplicitInLambda/shortenReferencesForReturnType.kt.after @@ -0,0 +1,7 @@ +import kotlin.support.AbstractIterator + +fun main(c: kotlin.support.AbstractIterator) { + val f = {(x: Int): AbstractIterator -> c} +} + +// WITH_RUNTIME \ No newline at end of file diff --git a/idea/tests/org/jetbrains/jet/plugin/intentions/IntentionTestGenerated.java b/idea/tests/org/jetbrains/jet/plugin/intentions/IntentionTestGenerated.java index 72e71b5d90c..da9e608962a 100644 --- a/idea/tests/org/jetbrains/jet/plugin/intentions/IntentionTestGenerated.java +++ b/idea/tests/org/jetbrains/jet/plugin/intentions/IntentionTestGenerated.java @@ -3510,6 +3510,11 @@ public class IntentionTestGenerated extends AbstractIntentionTest { doTest("idea/testData/intentions/makeTypeExplicitInLambda/shortenReferencesForReceiver.kt"); } + @TestMetadata("shortenReferencesForReturnType.kt") + public void testShortenReferencesForReturnType() throws Exception { + doTest("idea/testData/intentions/makeTypeExplicitInLambda/shortenReferencesForReturnType.kt"); + } + @TestMetadata("singleParam.kt") public void testSingleParam() throws Exception { doTest("idea/testData/intentions/makeTypeExplicitInLambda/singleParam.kt");