Files
kotlin-fork/compiler/testData/diagnostics/tests/FreeFunctionCalledAsExtension.kt
T
Mikhail Glukhikh 1274e2b90a Deprecate ExtensionFunctionType on a non-function types
Related to KT-43527
2022-01-14 22:20:44 +03:00

14 lines
397 B
Kotlin
Vendored

fun foo(a: (String) -> Unit) {
"".<!UNRESOLVED_REFERENCE!>a<!>()
}
interface A : (String) -> Unit {}
fun foo(a: <!WRONG_EXTENSION_FUNCTION_TYPE_WARNING!>@ExtensionFunctionType<!> A) {
// @Extension annotation on an unrelated type shouldn't have any effect on this diagnostic.
// Only kotlin.Function{n} type annotated with @Extension should
"".<!UNRESOLVED_REFERENCE!>a<!>()
}