b7d8e879a6
In particular, this commit includes: * Attempt to abstract access to FirSourceElement via FirModifier * Add more visit functions to DeclarationCheckersDiagnosticComponent * Add messages+factories for 4 modifier-related errors and warnings * Introduce FirModifierChecker
21 lines
570 B
Kotlin
Vendored
21 lines
570 B
Kotlin
Vendored
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
|
|
|
inline fun foo(noinline x: Int) {}
|
|
|
|
inline fun bar(y: Int, crossinline x: String) {}
|
|
|
|
fun gav(noinline x: (Int) -> Unit, crossinline y: (String) -> Int) {}
|
|
|
|
inline fun correct(noinline x: (Int) -> Unit, crossinline y: (String) -> Int) {}
|
|
|
|
inline fun incompatible(<!INCOMPATIBLE_MODIFIERS!>noinline<!> <!INCOMPATIBLE_MODIFIERS!>crossinline<!> x: () -> String) {}
|
|
|
|
class FunctionSubtype : () -> Unit {
|
|
override fun invoke() {}
|
|
}
|
|
|
|
inline fun functionSubtype(
|
|
noinline f: FunctionSubtype,
|
|
crossinline g: FunctionSubtype
|
|
) { }
|