Kotlin stdlib有kotlin
个根包和(see the full list with the content)个子包.
It seems not to be documented anywhere which of them are imported by default, but a peek into Kotlin Github sources suggests that these packages are imported for JVM target platform:
java.lang.*
kotlin.*
个
kotlin.annotation.*
kotlin.jvm.*
kotlin.collections.*
kotlin.ranges.*
kotlin.sequences.*
kotlin.text.*
kotlin.io.*
kotlin.coroutines.*
(to be added in Kotlin 1.1, not present in 1.0.4)
我已经手动测试了它们,上面的列表适用于Kotlin 1.0.4.默认情况下,这些stdlib包是not个导入的:
kotlin.comparisons.*
kotlin.concurrent.*
kotlin.properties.*
kotlin.reflect.*
kotlin.reflect.jvm.*
kotlin.system.*
正如@Magnus所指出的,JS平台are different的默认导入.