report UNRESOLVED_REFERENCE_WRONG_RECEIVER
mentioning candidates with wrong receiver
This commit is contained in:
@@ -9,9 +9,9 @@ class Customer(name: String)
|
||||
fun foo(f: File, c: Customer) {
|
||||
f.name
|
||||
|
||||
c.<!UNRESOLVED_REFERENCE!>name<!> // name should be unresolved here
|
||||
c.<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>name<!> // name should be unresolved here
|
||||
}
|
||||
|
||||
//from standard library
|
||||
val File.name: String
|
||||
get() = getName()
|
||||
get() = getName()
|
||||
@@ -6,26 +6,28 @@ package bar
|
||||
fun <R> List<R>.a() {}
|
||||
|
||||
fun test1(i: Int?) {
|
||||
1.<!UNRESOLVED_REFERENCE!>a<!>()
|
||||
i.<!UNRESOLVED_REFERENCE!>a<!>()
|
||||
1.<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>a<!>()
|
||||
i.<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>a<!>()
|
||||
}
|
||||
|
||||
fun <R> test2(c: Collection<R>) {
|
||||
c.<!UNRESOLVED_REFERENCE!>a<!>()
|
||||
c.<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>a<!>()
|
||||
}
|
||||
|
||||
fun Int.foo() {}
|
||||
|
||||
fun test3(s: String?) {
|
||||
"".<!UNRESOLVED_REFERENCE!>foo<!>()
|
||||
s.<!UNRESOLVED_REFERENCE!>foo<!>()
|
||||
"".<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>foo<!>()
|
||||
s.<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>foo<!>()
|
||||
"".<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>foo<!>(1)
|
||||
s.<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>foo<!>("a")
|
||||
}
|
||||
|
||||
trait A
|
||||
fun <T: A> T.c() {}
|
||||
|
||||
fun test4() {
|
||||
1.<!UNRESOLVED_REFERENCE!>c<!>()
|
||||
1.<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>c<!>()
|
||||
}
|
||||
|
||||
|
||||
@@ -46,4 +48,8 @@ fun List<String>.b() {}
|
||||
|
||||
fun test7(l: List<String?>) {
|
||||
<!TYPE_MISMATCH!>l<!>.b()
|
||||
}
|
||||
|
||||
fun test8(l: List<Any>?) {
|
||||
<!TYPE_MISMATCH!>l<!>.b()
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package a
|
||||
|
||||
class A {}
|
||||
|
||||
fun test(a1: A, a2: A) {
|
||||
val <!UNUSED_VARIABLE!>range<!> = "island".."isle"
|
||||
|
||||
a1<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>..<!>a2
|
||||
}
|
||||
|
||||
|
||||
public fun <T: Comparable<T>> T.rangeTo(<!UNUSED_PARAMETER!>that<!>: T): Range<T> {
|
||||
throw UnsupportedOperationException()
|
||||
}
|
||||
Reference in New Issue
Block a user