FIR: Make 'suspend fun', where 'suspend' is not builtin error in 1.8

#KT-49264
This commit is contained in:
Ilmir Usmanov
2022-03-30 00:37:37 +02:00
committed by teamcity
parent f75a8109d2
commit f473998e8b
9 changed files with 73 additions and 40 deletions
@@ -1,29 +0,0 @@
// SKIP_TXT
infix fun Int.suspend(c: () -> Unit) { c() }
fun bar() {
1 <!MODIFIER_FORM_FOR_NON_BUILT_IN_SUSPEND!>suspend<!> fun() {
println()
}
1 <!SYNTAX!>@Ann suspend fun()<!> {
println()
}
1 <!MODIFIER_FORM_FOR_NON_BUILT_IN_SUSPEND!>suspend<!> @Ann fun() {
println()
}
}
@Target(AnnotationTarget.EXPRESSION)
@Retention(AnnotationRetention.SOURCE)
annotation class Ann
fun main(suspend: WLambdaInvoke) {
1 <!MODIFIER_FORM_FOR_NON_BUILT_IN_SUSPEND!>suspend<!> fun() {}
}
class WLambdaInvoke {
operator fun Int.invoke(l: () -> Unit) {}
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// SKIP_TXT
infix fun Int.suspend(c: () -> Unit) { c() }