Introduce CoroutineImpl as a common super class for coroutines
The main benefit are class-files sizes for them (not repeating the same declaration for each coroutine) Also it helped to simplify coroutine codegen code a little Note that controller/label field become non-volatile (see KT-14636) #KT-14636 In Progress
This commit is contained in:
@@ -11,7 +11,7 @@ fun builder1(coroutine c: Controller.() -> Continuation<Unit>) {
|
||||
|
||||
fun builder2(coroutine c: Controller.() -> Continuation<Unit>) {
|
||||
val continuation = c(Controller())
|
||||
val declaredField = continuation!!.javaClass.getDeclaredField("label")
|
||||
val declaredField = continuation.javaClass.superclass.getDeclaredField("label")
|
||||
declaredField.setAccessible(true)
|
||||
declaredField.set(continuation, -3)
|
||||
continuation.resume(Unit)
|
||||
|
||||
Reference in New Issue
Block a user