Use correct function to check for function type in InlineParameterChecker
There's no use of noinline/crossinline modifiers on parameters of _subtypes_ of function types #KT-11411 Fixed
This commit is contained in:
@@ -9,3 +9,12 @@ fun gav(<!ILLEGAL_INLINE_PARAMETER_MODIFIER!>noinline<!> x: (Int) -> Unit, <!ILL
|
||||
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
|
||||
) { }
|
||||
|
||||
@@ -3,5 +3,14 @@ package
|
||||
public inline fun bar(/*0*/ y: kotlin.Int, /*1*/ crossinline x: kotlin.String): kotlin.Unit
|
||||
public inline fun correct(/*0*/ noinline x: (kotlin.Int) -> kotlin.Unit, /*1*/ crossinline y: (kotlin.String) -> kotlin.Int): kotlin.Unit
|
||||
public inline fun foo(/*0*/ noinline x: kotlin.Int): kotlin.Unit
|
||||
public inline fun functionSubtype(/*0*/ noinline f: FunctionSubtype, /*1*/ crossinline g: FunctionSubtype): kotlin.Unit
|
||||
public fun gav(/*0*/ noinline x: (kotlin.Int) -> kotlin.Unit, /*1*/ crossinline y: (kotlin.String) -> kotlin.Int): kotlin.Unit
|
||||
public inline fun incompatible(/*0*/ crossinline noinline x: () -> kotlin.String): kotlin.Unit
|
||||
|
||||
public final class FunctionSubtype : () -> kotlin.Unit {
|
||||
public constructor FunctionSubtype()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ fun invoke(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user