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
@@ -1,7 +1,7 @@
fun test1(f: String.() -> Unit) {
<!MISSING_RECEIVER!>(f)<!>()
(f)(<!NO_VALUE_FOR_PARAMETER!>)<!>
<!MISSING_RECEIVER!>f<!>()
f(<!NO_VALUE_FOR_PARAMETER!>)<!>
}
fun test2(f: (Int) -> Int) {
@@ -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!!
}
@@ -0,0 +1,19 @@
package
public fun foo(): A.() -> kotlin.Int
public fun test(/*0*/ foo: A.() -> kotlin.Int, /*1*/ a: A): kotlin.Unit
public final class A {
public constructor A()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public final class B {
public constructor B()
public final val foo: A.() -> kotlin.Int
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}