New J2K: handle correctly short names which are imported by default in kotlin (like List or Result)

Kotlin default import inserter was unable to correctly insert such imports

#KT-34165 fixed
This commit is contained in:
Ilya Kirillov
2019-10-04 12:30:02 +03:00
parent 81341e3fd3
commit f950a0246c
53 changed files with 181 additions and 40 deletions
+2
View File
@@ -1,6 +1,8 @@
// ERROR: The integer literal does not conform to the expected type CapturedType(*)
// ERROR: The integer literal does not conform to the expected type CapturedType(*)
// ERROR: Type argument is not within its bounds: should be subtype of 'String?'
import java.util.HashMap
internal class G<T : String?>(t: T)
class Java {
internal fun test() {
+2
View File
@@ -1,3 +1,5 @@
import java.util.ArrayList
internal object A {
@JvmStatic
fun main(args: Array<String>) {
+2
View File
@@ -1,5 +1,7 @@
package test
import java.util.HashMap
class TestPrimitiveFromMap {
fun foo(map: HashMap<String?, Int?>): Int {
return map["zzz"]!!
+2
View File
@@ -1,3 +1,5 @@
import java.util.HashMap
class TestMethodReference {
private val hashMap = HashMap<String, String>()
fun update(key: String, msg: String) {
+2
View File
@@ -1,3 +1,5 @@
import java.util.HashMap
class TestMethodReference {
private val hashMap = HashMap<String, String>()
fun update(key: String, msg: String) {
+1
View File
@@ -1,4 +1,5 @@
import Foo.SomeClass
import java.util.ArrayList
internal interface FooInterface {
fun foo(): ArrayList<out SomeClass?>?
+2
View File
@@ -1,3 +1,5 @@
import java.util.HashMap
class TestClass {
private val hashMap: Map<String, List<Int>> = HashMap()
}
+1
View File
@@ -1,3 +1,4 @@
import java.util.ArrayList
import java.util.function.Consumer
internal class Test {
+2
View File
@@ -1,5 +1,7 @@
package demo
import demo.One
internal class Container {
var myString = "1"
}
+2
View File
@@ -1,5 +1,7 @@
package demo
import demo.One
internal class Container {
var myInt = 1
}
+2
View File
@@ -1,5 +1,7 @@
package demo
import demo.One
internal class Container {
var myInt = 1
}
+2
View File
@@ -1,5 +1,7 @@
package demo
import demo.One
internal class Container {
var myInt = 1
}
+2
View File
@@ -1,5 +1,7 @@
package demo
import demo.One
internal class Container {
var myBoolean = true
}
+2
View File
@@ -1,3 +1,5 @@
import java.util.ArrayList
internal class A {
var list: List<String> = ArrayList()
}