fad35b95d4
Extension receivers are currently implicitly noinline, and changing that would require modifying the syntax to allow marking them noinline or crossinline. ^KT-5837 Open ^KT-25787 Fixed ^KT-47965 Fixed ^KT-50107 Fixed ^KT-52403 Fixed
29 lines
709 B
Kotlin
Vendored
29 lines
709 B
Kotlin
Vendored
// FIR_IDENTICAL
|
|
// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE -NOTHING_TO_INLINE
|
|
|
|
infix fun Function1<Int, Unit>.noInlineExt(p: Int) {}
|
|
|
|
inline infix fun Function1<Int, Unit>.inlineExt2(p: Int) {
|
|
noInlineExt(11)
|
|
this.noInlineExt(11)
|
|
this noInlineExt 11
|
|
this
|
|
}
|
|
|
|
inline fun Function1<Int, Unit>.inlineExt() {
|
|
inlineExt2(1)
|
|
this.inlineExt2(1)
|
|
this inlineExt2 1
|
|
}
|
|
|
|
inline fun testExtension(s: (p: Int) -> Unit) {
|
|
<!USAGE_IS_NOT_INLINABLE!>s<!>.inlineExt()
|
|
}
|
|
|
|
inline fun inlineFunWrongExtension(s: (p: Int) -> Unit) {
|
|
<!USAGE_IS_NOT_INLINABLE!>s<!>.noInlineExt(11)
|
|
}
|
|
|
|
inline fun inlineFunNoInline(noinline s: (p: Int) -> Unit) {
|
|
s.noInlineExt(11)
|
|
} |