Files
Roman Golyshev a3cb0253b9 KTIJ-30535 [kotlin] Move SuspiciousCollectionReassignmentInspection to the shared inspections module
Do not move the testdata to the shared place; regenerate it independently instead

^KTIJ-30535 Fixed

GitOrigin-RevId: 95f224416fa46598fc346180beaf4733cb2d58b2
2024-07-13 15:32:42 +00:00

15 lines
475 B
Kotlin

// "Replace with assignment (original is empty)" "false"
// TOOL: org.jetbrains.kotlin.idea.codeInsight.inspections.shared.SuspiciousCollectionReassignmentInspection
// ACTION: Change type to mutable
// ACTION: Replace overloaded operator with function call
// ACTION: Replace with ordinary assignment
// WITH_STDLIB
fun test(otherList: List<Int>) {
var list = listOf<Int>()
foo(list)
bar()
list <caret>+= otherList
}
fun foo(list: List<Int>) {}
fun bar() {}