Introduce Variable: Allow introduction of variables with 'dynamic' type
#KT-8483 Fixed
This commit is contained in:
+1
@@ -36,6 +36,7 @@ import kotlin.Unit;
|
|||||||
import kotlin.jvm.functions.Function1;
|
import kotlin.jvm.functions.Function1;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
import org.jetbrains.kotlin.analyzer.AnalysisResult;
|
||||||
import org.jetbrains.kotlin.builtins.KotlinBuiltIns;
|
import org.jetbrains.kotlin.builtins.KotlinBuiltIns;
|
||||||
import org.jetbrains.kotlin.idea.analysis.AnalyzerUtilKt;
|
import org.jetbrains.kotlin.idea.analysis.AnalyzerUtilKt;
|
||||||
import org.jetbrains.kotlin.idea.caches.resolve.ResolutionUtils;
|
import org.jetbrains.kotlin.idea.caches.resolve.ResolutionUtils;
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
fun foo(): dynamic = 1
|
||||||
|
|
||||||
|
fun test(): Any? {
|
||||||
|
return <selection>foo()</selection>
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
fun foo(): dynamic = 1
|
||||||
|
|
||||||
|
fun test(): Any? {
|
||||||
|
val foo = foo()
|
||||||
|
return foo
|
||||||
|
}
|
||||||
+6
@@ -115,6 +115,12 @@ public class JetExtractionTestGenerated extends AbstractJetExtractionTest {
|
|||||||
doIntroduceVariableTest(fileName);
|
doIntroduceVariableTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("dynamicType.kt")
|
||||||
|
public void testDynamicType() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("idea/testData/refactoring/introduceVariable/dynamicType.kt");
|
||||||
|
doIntroduceVariableTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("FewOccurrences.kt")
|
@TestMetadata("FewOccurrences.kt")
|
||||||
public void testFewOccurrences() throws Exception {
|
public void testFewOccurrences() throws Exception {
|
||||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/refactoring/introduceVariable/FewOccurrences.kt");
|
String fileName = JetTestUtils.navigationMetadata("idea/testData/refactoring/introduceVariable/FewOccurrences.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user