[FIR] Move tracking candidate applicability from CheckerSink to Candidate

This commit is contained in:
Dmitriy Novozhilov
2020-11-10 17:54:52 +03:00
parent f1ac1f177b
commit 67b262aa34
10 changed files with 31 additions and 36 deletions
@@ -11,10 +11,10 @@ fun test() {
const val <T> a3 = 0
<!INAPPLICABLE_LATEINIT_MODIFIER!>lateinit val <T> a4 = 0<!>
val <T> a5 by Delegate<Int>()
val <T> a6 by <!INAPPLICABLE_CANDIDATE!>Delegate<<!UNRESOLVED_REFERENCE!>T<!>>()<!>
val <T> a6 by Delegate<<!UNRESOLVED_REFERENCE!>T<!>>()
}
class Delegate<F> {
operator fun getValue(thisRef: Any?, property: KProperty<*>): String = ""
operator fun setValue(thisRef: Any?, property: KProperty<*>, value: String) {}
}
}
@@ -11,10 +11,10 @@ fun test() {
const val <T> a3 = 0
<!INAPPLICABLE_LATEINIT_MODIFIER!>lateinit val <T> a4 = 0<!>
val <T> a5 by Delegate<Int>()
val <T> a6 by <!INAPPLICABLE_CANDIDATE!>Delegate<<!UNRESOLVED_REFERENCE!>T<!>>()<!>
val <T> a6 by Delegate<<!UNRESOLVED_REFERENCE!>T<!>>()
}
class Delegate<F> {
operator fun getValue(thisRef: Any?, property: KProperty<*>): String = ""
operator fun setValue(thisRef: Any?, property: KProperty<*>, value: String) {}
}
}
@@ -5,7 +5,7 @@
import kotlin.reflect.KProperty
class B {
val c by <!INAPPLICABLE_CANDIDATE!><!INAPPLICABLE_CANDIDATE!>Delegate<!>(<!UNRESOLVED_REFERENCE!>ag<!>)<!>
val c by <!INAPPLICABLE_CANDIDATE!>Delegate<!>(<!UNRESOLVED_REFERENCE!>ag<!>)
}
class Delegate<T: Any>(val init: T) {
@@ -5,5 +5,5 @@ fun interface Bar {
operator fun Bar.plus(b: Bar): String = invoke() + b.invoke()
fun box(): String {
return { "O" } <!INAPPLICABLE_CANDIDATE!>+<!> { "K" }
return { "O" } + { "K" }
}
@@ -14,14 +14,14 @@ class A<T> {
fun foo2(a: A<out CharSequence>, b: A<in CharSequence>) {
a.<!INAPPLICABLE_CANDIDATE!>foo1<!>(Out<CharSequence>())
a.<!INAPPLICABLE_CANDIDATE!>foo1<!><Out<CharSequence>>(Out())
a.foo1<<!UPPER_BOUND_VIOLATED!>Out<CharSequence><!>>(Out())
a.foo1(Out())
a.foo1(Out<Nothing>())
a.foo2(Inv())
a.<!INAPPLICABLE_CANDIDATE!>foo2<!>(Inv<CharSequence>())
a.<!INAPPLICABLE_CANDIDATE!>foo2<!><Inv<CharSequence>>(Inv())
a.foo2<<!UPPER_BOUND_VIOLATED!>Inv<CharSequence><!>>(Inv())
a.foo3(In())
a.foo3(In<CharSequence>())
@@ -33,11 +33,11 @@ fun foo2(a: A<out CharSequence>, b: A<in CharSequence>) {
b.foo2(Inv())
b.<!INAPPLICABLE_CANDIDATE!>foo2<!>(Inv<CharSequence>())
b.<!INAPPLICABLE_CANDIDATE!>foo2<!><Inv<CharSequence>>(Inv())
b.foo2<<!UPPER_BOUND_VIOLATED!>Inv<CharSequence><!>>(Inv())
b.<!INAPPLICABLE_CANDIDATE!>foo3<!>(In<CharSequence>())
b.<!INAPPLICABLE_CANDIDATE!>foo3<!><In<CharSequence>>(In())
b.foo3<<!UPPER_BOUND_VIOLATED!>In<CharSequence><!>>(In())
b.foo3(In<Any?>())
b.foo3(In())