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:
Alexander Udalov
2016-03-14 15:17:45 +03:00
parent c18fab82e5
commit 33ff1e1e29
3 changed files with 20 additions and 2 deletions
@@ -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
) { }