FIR checker: Report VAL_OR_VAR_ON_*_PARAMETER.

This commit is contained in:
Mark Punzalan
2021-05-19 21:31:33 +00:00
committed by teamcityserver
parent 71c5c9f6c5
commit af99ad0736
23 changed files with 178 additions and 90 deletions
@@ -1,15 +0,0 @@
// KT-2667 Support multi-declarations in for-loops in control flow analysis
package d
class A {
operator fun component1() = 1
operator fun component2() = 2
operator fun component3() = 3
}
fun foo(list: List<A>) {
for (var (c1, c2, c3) in list) {
<!VAL_REASSIGNMENT!>c1<!> = 1
c3 + 1
}
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// KT-2667 Support multi-declarations in for-loops in control flow analysis
package d
@@ -1,12 +0,0 @@
fun f(
val a: Int,
var b: Int,
c: Int,
<!MULTIPLE_VARARG_PARAMETERS!>vararg<!> var d: Int,
<!MULTIPLE_VARARG_PARAMETERS!>vararg<!> val e: Int,
<!MULTIPLE_VARARG_PARAMETERS!>vararg<!> f: Int
) {
a + b + c + d[0] + e[0] + f[0] // to avoid 'unused parameter'
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
fun f(
<!VAL_OR_VAR_ON_FUN_PARAMETER!>val<!> a: Int,
<!VAL_OR_VAR_ON_FUN_PARAMETER!>var<!> b: Int,