Code Insight: Preserve identifier quotes in "Generate equals()/hashCode()/toString()" actions

#KT-15883 Fixed
This commit is contained in:
Alexey Sedunov
2017-01-23 14:55:36 +03:00
parent 7382d7c7d6
commit 983ad55357
11 changed files with 83 additions and 9 deletions
@@ -0,0 +1,3 @@
class Example(val `in`: String, val `cl ass`: String, val `valid`: Boolean) {
<caret>
}
@@ -0,0 +1,21 @@
class Example(val `in`: String, val `cl ass`: String, val `valid`: Boolean) {
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other?.javaClass != javaClass) return false
other as Example
if (`in` != other.`in`) return false
if (`cl ass` != other.`cl ass`) return false
if (`valid` != other.`valid`) return false
return true
}
override fun hashCode(): Int {
var result = `in`.hashCode()
result = 31 * result + `cl ass`.hashCode()
result = 31 * result + `valid`.hashCode()
return result
}
}