Introduce inspection detecting self-assignment of properties

So #KT-20714 Fixed
This commit is contained in:
Toshiaki Kameyama
2017-10-22 19:14:54 +03:00
committed by Mikhail Glukhikh
parent ffa9478d0c
commit 204d9e3423
34 changed files with 569 additions and 0 deletions
@@ -0,0 +1,17 @@
// 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
}
}
class ClientUser {
var id = ""
}