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:
@@ -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}
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user