• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package kotlinx.coroutines
2 
3 import kotlinx.coroutines.internal.*
4 import kotlin.coroutines.*
5 
6 // internal debugging tools for string representation
7 
8 internal actual val Any.hexAddress: String
9     get() = Integer.toHexString(System.identityHashCode(this))
10 
toDebugStringnull11 internal actual fun Continuation<*>.toDebugString(): String = when (this) {
12     is DispatchedContinuation -> toString()
13     // Workaround for #858
14     else -> runCatching { "$this@$hexAddress" }.getOrElse { "${this::class.java.name}@$hexAddress" }
15 }
16 
17 internal actual val Any.classSimpleName: String get() = this::class.java.simpleName
18