Mark as UNSUPPORTED suspension points in default parameters

#KT-16124 Fixed
 #KT-16218 Open
This commit is contained in:
Denis Zharkov
2017-02-07 16:20:12 +03:00
parent 4ee818addf
commit 4921bd822d
3 changed files with 30 additions and 0 deletions
@@ -0,0 +1,17 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
// SKIP_TXT
suspend fun foo() = 1
suspend fun bar(
x: Int = 2 + <!UNSUPPORTED!>foo<!>(),
y: suspend () -> Int = { foo() },
z: () -> Int = { <!NON_LOCAL_SUSPENSION_POINT!>foo<!>() },
w: Int = myInline { <!UNSUPPORTED!>foo<!>() },
v: Any? = object {
fun x() = <!NON_LOCAL_SUSPENSION_POINT!>foo<!>()
suspend fun y() = foo()
}
) {}
inline fun myInline(x: () -> Unit) = 1