mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
There's no use of noinline/crossinline modifiers on parameters of _subtypes_ of function types #KT-11411 Fixed
21 lines
914 B
Kotlin
Vendored
21 lines
914 B
Kotlin
Vendored
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
|
|
|
<!NOTHING_TO_INLINE!>inline<!> fun foo(<!ILLEGAL_INLINE_PARAMETER_MODIFIER!>noinline<!> x: Int) {}
|
|
|
|
<!NOTHING_TO_INLINE!>inline<!> fun bar(y: Int, <!ILLEGAL_INLINE_PARAMETER_MODIFIER!>crossinline<!> x: String) {}
|
|
|
|
fun gav(<!ILLEGAL_INLINE_PARAMETER_MODIFIER!>noinline<!> x: (Int) -> Unit, <!ILLEGAL_INLINE_PARAMETER_MODIFIER!>crossinline<!> y: (String) -> Int) {}
|
|
|
|
inline fun correct(noinline x: (Int) -> Unit, crossinline y: (String) -> Int) {}
|
|
|
|
<!NOTHING_TO_INLINE!>inline<!> fun incompatible(<!INCOMPATIBLE_MODIFIERS!>noinline<!> <!INCOMPATIBLE_MODIFIERS!>crossinline<!> x: () -> String) {}
|
|
|
|
class FunctionSubtype : () -> Unit {
|
|
override fun invoke() {}
|
|
}
|
|
|
|
<!NOTHING_TO_INLINE!>inline<!> fun functionSubtype(
|
|
<!ILLEGAL_INLINE_PARAMETER_MODIFIER!>noinline<!> f: FunctionSubtype,
|
|
<!ILLEGAL_INLINE_PARAMETER_MODIFIER!>crossinline<!> g: FunctionSubtype
|
|
) { }
|