FIR checker: introduce NO_(GET|SET)_METHOD

Besides introducing new diagnostics, this commit unifies source usages
for array accesses in PSI & LT.
This commit is contained in:
Tianyu Geng
2021-03-11 16:01:58 -08:00
committed by Mikhail Glukhikh
parent 651fd4ad9f
commit e1c80ac75c
32 changed files with 137 additions and 100 deletions
@@ -96,7 +96,7 @@ fun case_7() {
fun case_8(y: MutableList<Boolean>) {
var x: Boolean? = true
if (x != null) {
<!INAPPLICABLE_CANDIDATE!>y[if (true) {x = null;0} else 0] = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean?")!>x<!><!>
<!INAPPLICABLE_CANDIDATE!>y[if (true) {x = null;0} else 0]<!> = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean?")!>x<!>
}
}
@@ -130,6 +130,6 @@ fun case_10() {
fun case_11(y: MutableList<MutableList<Int>>) {
var x: Int? = 10
if (x != null) {
<!INAPPLICABLE_CANDIDATE!>y[if (true) {x = null;0} else 0][x] = 10<!>
<!INAPPLICABLE_CANDIDATE!>y[if (true) {x = null;0} else 0][x]<!> = 10
}
}
@@ -6,6 +6,6 @@
fun <T : List<T>> Inv<out T>.case_1() {
if (this is MutableList<*>) {
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<out T> & kotlin.collections.MutableList<*> & Inv<out T>")!>this<!>
<!INAPPLICABLE_CANDIDATE!><!DEBUG_INFO_EXPRESSION_TYPE("Inv<out T> & kotlin.collections.MutableList<*> & Inv<out T>")!>this<!>[0] = <!DEBUG_INFO_EXPRESSION_TYPE("Inv<out T> & kotlin.collections.MutableList<*> & Inv<out T>")!>this<!>[1]<!>
<!INAPPLICABLE_CANDIDATE!><!DEBUG_INFO_EXPRESSION_TYPE("Inv<out T> & kotlin.collections.MutableList<*> & Inv<out T>")!>this<!>[0]<!> = <!DEBUG_INFO_EXPRESSION_TYPE("Inv<out T> & kotlin.collections.MutableList<*> & Inv<out T>")!>this<!>[1]
}
}