Files
kotlin-fork/compiler/testData/diagnostics/tests/FreeFunctionCalledAsExtension.kt
T
2015-11-30 02:51:04 +03:00

14 lines
421 B
Kotlin
Vendored

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