Generate equals/hashCode(): Enable for classes without properties

Also:
- forbid for enum classes
- use javaClass.hashCode() instead of 0 if class has no properties

 #KT-18418 Fixed
This commit is contained in:
Alexey Sedunov
2017-06-15 17:32:20 +03:00
parent 895407f5e3
commit 9681f5ca42
9 changed files with 10 additions and 30 deletions
@@ -0,0 +1,15 @@
class A {
fun foo() {
}
<caret>override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other?.javaClass != javaClass) return false
return true
}
override fun hashCode(): Int {
return javaClass.hashCode()
}
}