Changed priority for default imports + default imports include all built-ins explicitly for java module

#KT-4374 Fixed
This commit is contained in:
Valentin Kipyatkov
2015-01-19 19:17:23 +03:00
parent ae9ebbec7d
commit b9d47ffe7a
14 changed files with 76 additions and 86 deletions
@@ -0,0 +1,6 @@
import java.lang.reflect.*
import <!PLATFORM_CLASS_MAPPED_TO_KOTLIN!>java.util.List<!>
fun foo(
<!UNUSED_PARAMETER!>p1<!>: Array<String> /* should be resolved to kotlin.Array */,
<!UNUSED_PARAMETER!>p2<!>: <!PLATFORM_CLASS_MAPPED_TO_KOTLIN!>List<String><!> /* should be resolved to java.util.List */) { }
@@ -0,0 +1,3 @@
package
internal fun foo(/*0*/ p1: kotlin.Array<kotlin.String>, /*1*/ p2: java.util.List<kotlin.String>): kotlin.Unit
@@ -4,8 +4,8 @@ package test
import testing.custom.*
// Non default import has priority over default one. No conflicts are expected.
val a1: `custom`List<Int>? = null
// Default import has priority over on-demand ones. No conflicts are expected.
val a1: `kotlin::List`List<Int>? = null
//FILE:javaUtilImport.kt
//----------------------------------------------------------------------------------
@@ -13,7 +13,7 @@ package test
import java.util.*
// Mapped declarations are dropped from on-demand imports.
// Default imports take over import-on-demand
// TODO: Fix for lazy resolve test
// val a2: 'kotlin::List'List<Int>? = null
@@ -24,8 +24,8 @@ package test
import testing.custom.*
import java.util.*
// Mapped declarations are dropped from on-demand "java.util" import. So no conflicts are expected.
val a3: `custom`List<Int>? = null
// Default import has priority over on-demand ones. No conflicts are expected.
val a3: `kotlin::List`List<Int>? = null
//FILE:singleClassImportFromJavaUtil.kt
//----------------------------------------------------------------------------------
+3 -3
View File
@@ -29,9 +29,9 @@ class WithPredicate() {
val p : Boolean
}
open class List<E>()
open class AbstractList<E> : List<E?>
open class ArrayList<E>() : Any, AbstractList<E?>, List<E?>
open class InvList<E>()
open class AbstractList<E> : InvList<E?>
open class ArrayList<E>() : Any, AbstractList<E?>, InvList<E?>
fun f() : Unit {}
fun f(a : Int) : Int {a}