KT-3459 "import java.util.*" is removed by optimize imports if the only usage is a SAM constructor

#KT-3459 fixed
This commit is contained in:
Evgeny Gerashchenko
2013-04-03 17:42:44 +04:00
parent 8f1b728a08
commit 6e43b78deb
8 changed files with 21 additions and 2 deletions
@@ -0,0 +1,3 @@
import java.util.*
val c = Comparator {(x: Int, y: Int) -> 1}
@@ -0,0 +1,3 @@
import java.util.*
val c = Comparator {(x: Int, y: Int) -> 1}
+1
View File
@@ -0,0 +1 @@
val c = java.util.<caret>Comparator {(x: Int, y: Int) -> 1}
@@ -81,6 +81,10 @@ public class OptimizeImportsTest extends LightCodeInsightTestCase {
doTest();
}
public void testSamConstructor() throws Exception {
doTest();
}
public void doTest() throws Exception {
configureByFile(fileName());
invokeFormatFile();
@@ -50,6 +50,10 @@ public class ResolveBaseTest extends LightCodeInsightTestCase {
doSingleResolveTest("test1");
}
public void testSamConstructor() throws Exception {
doSingleResolveTest("(java.util).Comparator");
}
public void testSeveralOverrides() throws Exception {
doMultiResolveTest();
}