Created warning for KT-9805

#KT-9805 In Progress
This commit is contained in:
Stanislav Erokhin
2015-11-10 11:01:18 +03:00
committed by Valentin Kipyatkov
parent 8664d778ad
commit a3b11f4214
9 changed files with 226 additions and 1 deletions
@@ -0,0 +1,19 @@
class A {
val foo: B.() -> Unit get() = null!!
}
class B
fun test(a: A, b: B) {
with(b) {
a.<!INVOKE_ON_EXTENSION_FUNCTION_WITH_EXPLICIT_DISPATCH_RECEIVER!>foo<!>() // here must be error, because a is not extension receiver
a.foo(this)
(a.foo)()
(a.foo)(this)
}
}
public inline fun <T, R> with(receiver: T, f: T.() -> R): R = receiver.f()