Change Signature: Add test for KT-5784 "Generate import on function refactoring when parameter changes type"

#KT-5784 Fixed
This commit is contained in:
Alexey Sedunov
2015-02-20 16:44:57 +03:00
parent a21163b8c4
commit 95675176df
5 changed files with 32 additions and 0 deletions
@@ -0,0 +1,5 @@
package b
import a.Bar
fun foo(o: Bar) {}
@@ -0,0 +1,9 @@
package a
import b.foo
class Bar
fun test() {
foo(Bar())
}
@@ -0,0 +1,3 @@
package b
fun foo(o: Any) {}
@@ -0,0 +1,9 @@
package a
import b.foo
class Bar
fun test() {
<caret>foo(Bar())
}
@@ -722,6 +722,12 @@ public class JetChangeSignatureTest extends KotlinCodeInsightTestCase {
doTest(changeInfo);
}
public void testChangeParameterTypeWithImport() throws Exception {
JetChangeInfo changeInfo = getChangeInfo();
changeInfo.getNewParameters()[0].setCurrentTypeText("a.Bar");
doTest(changeInfo);
}
@NotNull
@Override
protected String getTestDataPath() {