Change Signature: Add test for KT-5784 "Generate import on function refactoring when parameter changes type"
#KT-5784 Fixed
This commit is contained in:
@@ -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())
|
||||||
|
}
|
||||||
+6
@@ -722,6 +722,12 @@ public class JetChangeSignatureTest extends KotlinCodeInsightTestCase {
|
|||||||
doTest(changeInfo);
|
doTest(changeInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testChangeParameterTypeWithImport() throws Exception {
|
||||||
|
JetChangeInfo changeInfo = getChangeInfo();
|
||||||
|
changeInfo.getNewParameters()[0].setCurrentTypeText("a.Bar");
|
||||||
|
doTest(changeInfo);
|
||||||
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
protected String getTestDataPath() {
|
protected String getTestDataPath() {
|
||||||
|
|||||||
Reference in New Issue
Block a user