report UNRESOLVED_REFERENCE_WRONG_RECEIVER

mentioning candidates with wrong receiver
This commit is contained in:
Svetlana Isakova
2013-06-17 19:05:54 +04:00
parent 3340b94bd8
commit 041505f5b8
19 changed files with 142 additions and 49 deletions
@@ -0,0 +1,17 @@
fun Int.foo() {}
open class A {
~A.foo~fun foo(i: Int) {}
}
open class B {}
fun test(a: A, b: B) {
with (a) {
with (b) {
// at first we try b.foo, so 'Int.foo' should have less priority to be thrown away
`A.foo`foo(1.0)
}
}
}
fun <T, R> with(receiver: T, f: T.() -> R) : R = receiver.f()