[K2] Disappeared UNSUPPORTED

Mark as UNSUPPORTED suspension points in default parameters

^KT-59881
This commit is contained in:
Anastasia.Nekrasova
2023-11-23 09:29:07 +00:00
committed by Space Team
parent c1f6fe1e76
commit 6471080c48
3 changed files with 28 additions and 6 deletions
@@ -4,10 +4,11 @@
suspend fun foo() = 1
suspend fun bar(
x: Int = 2 + foo(),
x: Int = 2 + <!UNSUPPORTED!>foo()<!>,
y: suspend () -> Int = { foo() },
z: () -> Int = { <!NON_LOCAL_SUSPENSION_POINT!>foo<!>() },
w: Int = myInline { foo() },
w: Int = myInline { <!UNSUPPORTED!>foo()<!> },
q: Int = myInline2 { <!NON_LOCAL_SUSPENSION_POINT!>foo<!>() },
v: Any? = object {
fun x() = <!NON_LOCAL_SUSPENSION_POINT!>foo<!>()
suspend fun y() = foo()
@@ -15,3 +16,4 @@ suspend fun bar(
) {}
inline fun myInline(x: () -> Unit) = 1
inline fun myInline2(crossinline x: () -> Unit) = 1
@@ -8,6 +8,7 @@ suspend fun bar(
y: suspend () -> Int = { foo() },
z: () -> Int = { <!NON_LOCAL_SUSPENSION_POINT!>foo<!>() },
w: Int = myInline { <!UNSUPPORTED!>foo<!>() },
q: Int = myInline2 { <!NON_LOCAL_SUSPENSION_POINT!>foo<!>() },
v: Any? = object {
fun x() = <!NON_LOCAL_SUSPENSION_POINT!>foo<!>()
suspend fun y() = foo()
@@ -15,3 +16,4 @@ suspend fun bar(
) {}
inline fun myInline(x: () -> Unit) = 1
inline fun myInline2(crossinline x: () -> Unit) = 1