Having some strange behavior with imports in kotlinc-jvm β only the first import seems to work. For example:
~ kotlinc-jvm
Welcome to Kotlin version 1.0.0 (JRE 1.8.0_71-b15)
Type :help for help, :quit for quit
>>> import java.util.Base64
>>> var e = Base64.getEncoder()
>>> import java.nio.ByteBuffer
>>> var bb = ByteBuffer.wrap(ByteArray(16))
error: unresolved reference: ByteBuffer
var bb = ByteBuffer.wrap(ByteArray(16))
^
but if running the above two imports in reverse order:
~ kotlinc-jvm
Welcome to Kotlin version 1.0.0 (JRE 1.8.0_71-b15)
Type :help for help, :quit for quit
>>> import java.nio.ByteBuffer
>>> var bb = ByteBuffer.wrap(ByteArray(16))
>>> import java.util.Base64
>>> var e = Base64.getEncoder()
error: unresolved reference: Base64
var e = Base64.getEncoder()
^
I note that it does work correctly when running a script using the -script
parameter (but the script has to be named correctly with a .kts extension otherwise there are other errors).