Created warning for KT-9805
#KT-9805 In Progress
This commit is contained in:
committed by
Valentin Kipyatkov
parent
8664d778ad
commit
a3b11f4214
@@ -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()
|
||||
Reference in New Issue
Block a user