FIR checker: report VAL_REASSIGNMENT on value parameter
This commit is contained in:
committed by
TeamCityServer
parent
2486555208
commit
03f85bea8f
@@ -59,7 +59,7 @@ fun canBe(i0: Int, j: Int) {
|
||||
var i = i0
|
||||
(label@ i) = 34
|
||||
|
||||
(label@ j) = 34 //repeat for j
|
||||
(label@ <!VAL_REASSIGNMENT!>j<!>) = 34 //repeat for j
|
||||
|
||||
val a = A()
|
||||
(l@ a.a) = 3894
|
||||
@@ -69,7 +69,7 @@ fun canBe(i0: Int, j: Int) {
|
||||
}
|
||||
|
||||
fun canBe2(j: Int) {
|
||||
(label@ j) = 34
|
||||
(label@ <!VAL_REASSIGNMENT!>j<!>) = 34
|
||||
}
|
||||
|
||||
class A() {
|
||||
|
||||
Vendored
+2
-2
@@ -54,7 +54,7 @@ fun t2() {
|
||||
class A() {}
|
||||
|
||||
fun t4(a: A) {
|
||||
a = A()
|
||||
<!VAL_REASSIGNMENT!>a<!> = A()
|
||||
}
|
||||
|
||||
// ------------------------------------------------
|
||||
@@ -188,7 +188,7 @@ class AnonymousInitializers(var a: String, val b: String) {
|
||||
}
|
||||
|
||||
fun reassignFunParams(a: Int) {
|
||||
a = 1
|
||||
<!VAL_REASSIGNMENT!>a<!> = 1
|
||||
}
|
||||
|
||||
open class Open(a: Int, w: Int) {}
|
||||
|
||||
Vendored
+1
-1
@@ -5,7 +5,7 @@ fun testPrefix() {
|
||||
|
||||
fun testPostfixWithCall(n: Nothing) {
|
||||
operator fun Nothing.inc(): Nothing = this
|
||||
n++
|
||||
<!VAL_REASSIGNMENT!>n<!>++
|
||||
}
|
||||
|
||||
fun testPostfixSpecial() {
|
||||
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
@Suppress("warnings")
|
||||
class C {
|
||||
fun foo(p: String??) {
|
||||
// Make sure errors are not suppressed:
|
||||
p = ""
|
||||
}
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
@Suppress("warnings")
|
||||
class C {
|
||||
fun foo(p: String??) {
|
||||
|
||||
Reference in New Issue
Block a user