[FIR] Implement UNRESOLVED_REFERENCE_WRONG_RECEIVER
This commit is contained in:
Vendored
-17
@@ -1,17 +0,0 @@
|
||||
class A<T> {
|
||||
fun T.foo() {}
|
||||
fun Out<T>.bar() {}
|
||||
}
|
||||
class Out<out E>
|
||||
|
||||
fun test(x: A<out CharSequence>, y: Out<CharSequence>) {
|
||||
with(x) {
|
||||
// TODO: this diagnostic could be replaced with TYPE_MISMATCH_DUE_TO_TYPE_PROJECTION
|
||||
"".<!INAPPLICABLE_CANDIDATE!>foo<!>()
|
||||
y.<!INAPPLICABLE_CANDIDATE!>bar<!>()
|
||||
|
||||
with(y) {
|
||||
<!INAPPLICABLE_CANDIDATE!>bar<!>()
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
class A<T> {
|
||||
fun T.foo() {}
|
||||
fun Out<T>.bar() {}
|
||||
|
||||
+1
-1
@@ -10,5 +10,5 @@ fun main() {
|
||||
val c : ListOfLists<*> = b
|
||||
val d : ArrayList<ArrayList<*>> = <!INITIALIZER_TYPE_MISMATCH!>c.x<!>
|
||||
|
||||
c.x checkType { <!INAPPLICABLE_CANDIDATE!>_<!><ArrayList<out ArrayList<*>>>() }
|
||||
c.x checkType { <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>_<!><ArrayList<out ArrayList<*>>>() }
|
||||
}
|
||||
|
||||
+2
-2
@@ -9,10 +9,10 @@ public class Clazz<T> {
|
||||
// FILE: main.kt
|
||||
fun test(clazz: Clazz<*>) {
|
||||
clazz.t checkType { _<Any?>() }
|
||||
clazz.getSuperClass() checkType { <!INAPPLICABLE_CANDIDATE!>_<!><Clazz<*>?>() }
|
||||
clazz.getSuperClass() checkType { <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>_<!><Clazz<*>?>() }
|
||||
clazz.getSuperClass().t checkType { _<Any?>() }
|
||||
|
||||
clazz.superClass checkType { <!INAPPLICABLE_CANDIDATE!>_<!><Clazz<*>?>() }
|
||||
clazz.superClass checkType { <!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>_<!><Clazz<*>?>() }
|
||||
clazz.superClass.t checkType { _<Any?>() }
|
||||
|
||||
// See KT-9294
|
||||
|
||||
Reference in New Issue
Block a user