I have function:
fun buttonClick(view: View){
CoroutineScope(Dispatchers.Default).launch{ //this:CoroutineScope
Log.i(TAG,"${this.javaClass.toString()}")
while (this.isActive) {
//...
}
}
}
In Logcat I see: class kotlinx.coroutines.StandaloneCoroutine. But if I step inside while (this.isActive) while debugging, I see call of CoroutineScope.isActive - not a call of StandaloneCoroutine (or AbstractCoroutine) method. i.e. "this" have CoroutineScope type- not StandaloneCoroutine. Could anyone explain this behavior of "this"?