Check for COROUTINE_SUSPENDED inside callable reference

#KT-41429 Fixed
This commit is contained in:
Ilmir Usmanov
2020-09-01 21:34:31 +02:00
parent 4303e8126f
commit 1c97eafea8
17 changed files with 98 additions and 14 deletions

View File

@@ -23,4 +23,5 @@ suspend fun test() {
// -- 1 in 'useICAny(suspendGeneric(ICAny("")))
// -- 1 in 'equals-impl' for ICAny
// 2 INVOKEVIRTUAL ICAny\.unbox-impl
// -- 2 on resume path of suspendICAny
// 4 INVOKEVIRTUAL ICAny\.unbox-impl

View File

@@ -11,14 +11,14 @@ fun useIC(x: IC1) {}
fun useAny(x: Any) {}
suspend fun test() {
useIC(suspendIC())
useIC(suspendIC()) // IC1.unbox-impl of resume path
useIC(suspendGeneric(IC1(IC0("")))) // IC1.box-impl, IC1.unbox-impl
useAny(suspendAny())
useAny(suspendIC()) // IC1.box-impl
useAny(suspendIC()) // IC1.box-impl, IC1.unbox-impl of resume path
}
// 0 INVOKESTATIC IC0\.box-impl
// 3 INVOKESTATIC IC1\.box-impl
// 1 INVOKEVIRTUAL IC0\.unbox-impl
// 2 INVOKEVIRTUAL IC1\.unbox-impl
// 4 INVOKEVIRTUAL IC1\.unbox-impl

View File

@@ -23,4 +23,5 @@ suspend fun test() {
// -- 1 in 'useICString(suspendGeneric(ICString("")))
// -- 1 in 'equals-impl' for ICString
// 2 INVOKEVIRTUAL ICString\.unbox-impl
// -- 2 in resume path of suspendICString
// 4 INVOKEVIRTUAL ICString\.unbox-impl

View File

@@ -7,5 +7,5 @@ inline class OurAny(val a: Any)
suspend fun returnsUnboxed(): OurAny = OurAny("OK")
// 1 INVOKESTATIC kotlin/Result.box-impl
// 0 INVOKESTATIC kotlin/Result.box-impl
// 0 INVOKESTATIC OurAny.box-impl