操作数堆栈上的错误types与Kotlin协同程序

这段代码与Kotlin 1.2.10编译成功,但是当我运行它时,它会java.lang.VerifyError: Bad type on operand stack产生一个java.lang.VerifyError: Bad type on operand stack 。 如果我删除了Test类并将其提取出来,它将按预期工作。 这是为什么?

 import kotlinx.coroutines.experimental.delay import kotlinx.coroutines.experimental.launch import kotlinx.coroutines.experimental.runBlocking import java.util.* import kotlin.concurrent.schedule class Test { fun scheduleTimeout() { Timer(true).schedule(300) { launch { runSuspended("hello") } } } suspend fun runSuspended(txt: String) = println(txt) } fun main(args: Array) { Test().scheduleTimeout() runBlocking { delay(10000) } } 

完全例外:

 Exception in thread "Timer-0" java.lang.VerifyError: Bad type on operand stack Exception Details: Location: Test$scheduleTimeout$$inlined$schedule$1$lambda$1.create(Lkotlinx/coroutines/experimental/CoroutineScope;Lkotlin/coroutines/experimental/Continuation;)Lkotlin/coroutines/experimental/Continuation; @18: invokespecial Reason: Type 'Test$scheduleTimeout$$inlined$schedule$1$lambda$1' (current frame, stack[3]) is not assignable to 'Test$scheduleTimeout$$inlined$schedule$1' Current Frame: bci: @18 flags: { } locals: { 'Test$scheduleTimeout$$inlined$schedule$1$lambda$1', 'kotlinx/coroutines/experimental/CoroutineScope', 'kotlin/coroutines/experimental/Continuation' } stack: { uninitialized 12, uninitialized 12, 'kotlin/coroutines/experimental/Continuation', 'Test$scheduleTimeout$$inlined$schedule$1$lambda$1' } Bytecode: 0x0000000: 2b12 64b8 006a 2c12 6cb8 006a bb00 0259 0x0000010: 2c2a b700 6e4e 2d2b b500 3d2d 3a04 1904 0x0000020: b0 at Test$scheduleTimeout$$inlined$schedule$1.run(Timer.kt:145) at java.util.TimerThread.mainLoop(Timer.java:555) at java.util.TimerThread.run(Timer.java:505)