Replace global mutable object with global variable

This commit is contained in:
Ilmir Usmanov
2019-03-25 09:07:32 +03:00
parent 9813b748eb
commit 95f4115a10
@@ -77,7 +77,7 @@ fun createTextForHelpers(isReleaseCoroutines: Boolean, checkStateMachine: Boolea
"" ""
val checkStateMachineString = """ val checkStateMachineString = """
object StateMachineChecker { class StateMachineCheckerClass {
private var counter = 0 private var counter = 0
var finished = false var finished = false
@@ -106,6 +106,7 @@ fun createTextForHelpers(isReleaseCoroutines: Boolean, checkStateMachine: Boolea
if (!finished) error("Wrong state-machine generated: it is not finished yet") if (!finished) error("Wrong state-machine generated: it is not finished yet")
} }
} }
val StateMachineChecker = StateMachineCheckerClass()
object CheckStateMachineContinuation: ContinuationAdapter<Unit>() { object CheckStateMachineContinuation: ContinuationAdapter<Unit>() {
override val context: CoroutineContext override val context: CoroutineContext
get() = EmptyCoroutineContext get() = EmptyCoroutineContext