Files
kotlin-fork/idea/testData/inspectionsLocal/selfAssignment/applyIncorrect.kt
T
2017-11-02 11:07:52 +03:00

18 lines
352 B
Kotlin
Vendored

// PROBLEM: Variable 'city' is assigned to itself
// WITH_RUNTIME
// FIX: Remove self assignment
// Minimized from KT-20714 itself
class ServerUser {
var id = ""
var city = ""
fun toClientUser() = ClientUser().apply {
id = this@ServerUser.id
city = <caret>this@ServerUser.city
}
}
class ClientUser {
var id = ""
}