[FIR] Prohibit suspend anonymous functions in statement position
^KT-62018 Fixed ^KT-62019
This commit is contained in:
committed by
Space Team
parent
cae6e0ee0f
commit
fb00c1dfb6
+13
@@ -0,0 +1,13 @@
|
||||
FILE: suspendAnonymousFunction.kt
|
||||
public final fun take(f: R|suspend () -> kotlin/Unit|): R|kotlin/Unit| {
|
||||
}
|
||||
public final fun test_1(): R|kotlin/Unit| {
|
||||
suspend fun <anonymous>(): R|kotlin/Unit| <inline=Unknown> {
|
||||
}
|
||||
|
||||
}
|
||||
public final fun test_2(): R|kotlin/Unit| {
|
||||
R|/take<Inapplicable(INAPPLICABLE_ARGUMENTS_MAPPING_ERROR): /take>#|(<Unresolved name: suspend>#, fun <anonymous>(): R|kotlin/Unit| <inline=Unknown> {
|
||||
}
|
||||
)
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// ISSUE: KT-62018, KT-62019
|
||||
|
||||
fun take(f: suspend () -> Unit) {}
|
||||
|
||||
fun test_1() {
|
||||
<!ANONYMOUS_SUSPEND_FUNCTION!>suspend<!> fun() {}
|
||||
}
|
||||
|
||||
fun test_2() {
|
||||
take(<!UNRESOLVED_REFERENCE!>suspend<!><!SYNTAX!><!> <!TOO_MANY_ARGUMENTS!>fun () {}<!>)
|
||||
}
|
||||
Reference in New Issue
Block a user