https://kotlinlang.org logo
Title
a

andredasilvapinto

12/31/2017, 7:01 PM
Hello! This - https://gist.github.com/andredasilvapinto/a63468acd56498fd6f17bcad2905d41b - compiles but when I run it produces a
java.lang.VerifyError: Bad type on operand stack
(full error on the gist comment). Why is that?
k

kingsley

12/31/2017, 8:20 PM
Looks like a bug with coroutines bytecode and inlining. You should file a bug report kotl.in/issue
You can use the member schedule directly though. Slightly more verbose, but works:
Timer(true).schedule(object: TimerTask() {
    override fun run() {
        launch {
            runSuspended("hello")
        }
    }
}, 300)
a

andredasilvapinto

01/01/2018, 12:44 PM