Allowed call value with extension function type as simple function type.

This commit is contained in:
Stanislav Erokhin
2015-10-30 19:40:39 +03:00
parent b6f724cf58
commit 77411b2181
7 changed files with 52 additions and 5 deletions
@@ -0,0 +1,22 @@
// !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())
<!UNREACHABLE_CODE!>return<!> null!!
}