Introduce Variable: Allow introduction of variables with 'dynamic' type

#KT-8483 Fixed
This commit is contained in:
Alexey Sedunov
2015-10-23 20:08:17 +03:00
parent 6dd58ad197
commit 18ed3055ee
4 changed files with 18 additions and 0 deletions
@@ -36,6 +36,7 @@ import kotlin.Unit;
import kotlin.jvm.functions.Function1;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.kotlin.analyzer.AnalysisResult;
import org.jetbrains.kotlin.builtins.KotlinBuiltIns;
import org.jetbrains.kotlin.idea.analysis.AnalyzerUtilKt;
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
}
@@ -115,6 +115,12 @@ public class JetExtractionTestGenerated extends AbstractJetExtractionTest {
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")
public void testFewOccurrences() throws Exception {
String fileName = JetTestUtils.navigationMetadata("idea/testData/refactoring/introduceVariable/FewOccurrences.kt");