Files
kotlin-fork/compiler/testData/diagnostics/tests/resolve/invoke/extensionValueAsNonExtension.kt
T
2021-05-25 13:28:29 +03:00

24 lines
384 B
Kotlin
Vendored

// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE
class A
fun test(foo: A.() -> Int, a: A) {
val b: Int = foo(a)
val c: Int = (foo)(a)
}
class B {
val foo: A.() -> Int = null!!
init {
val b: Int = foo(A())
}
}
fun foo(): A.() -> Int {
val b: Int = foo()(A())
val c: Int = (foo())(A())
return null!!
}