Fix exception when add import

#KT-30524 Fixed
This commit is contained in:
Dmitry Gridin
2019-03-20 22:59:10 +07:00
parent 3ce002dd6e
commit 403801b0b3
5 changed files with 37 additions and 1 deletions
@@ -236,7 +236,7 @@ public class Visibilities {
public static final Visibility LOCAL = new Visibility("local", false) {
@Override
public boolean mustCheckInImports() {
throw new IllegalStateException("This method shouldn't be invoked for LOCAL visibility");
return true;
}
@Override
@@ -0,0 +1,10 @@
package test
fun a1() {}
fun a2() {}
fun a3() {}
fun a4() {}
fun a5() {}
fun a6() {}
fun a7() {}
val kotlinType = "ds"
+13
View File
@@ -0,0 +1,13 @@
// IMPORT: test.a7
import test.a1
import test.a2
import test.a3
import test.a4
import test.a5
import test.a6
fun test() {
val kotlinType = ""
kotlinType
a7()
}
+8
View File
@@ -0,0 +1,8 @@
// IMPORT: test.a7
import test.*
fun test() {
val kotlinType = ""
kotlinType
a7()
}
@@ -59,6 +59,11 @@ public class AddImportTestGenerated extends AbstractAddImportTest {
runTest("idea/testData/addImport/CommentsNoPackageDirective.kt");
}
@TestMetadata("ConflictingLocalRef.kt")
public void testConflictingLocalRef() throws Exception {
runTest("idea/testData/addImport/ConflictingLocalRef.kt");
}
@TestMetadata("ConflictingNameAppearsAndHasUsage1.kt")
public void testConflictingNameAppearsAndHasUsage1() throws Exception {
runTest("idea/testData/addImport/ConflictingNameAppearsAndHasUsage1.kt");