Prohibit to override equals/hashCode in enums

#KT-5721 Fixed
This commit is contained in:
Alexander Udalov
2014-10-16 20:29:29 +04:00
parent 6ec71b3fd1
commit 66a7a58313
4 changed files with 53 additions and 3 deletions
@@ -0,0 +1,9 @@
enum class E {
ENTRY;
<!OVERRIDING_FINAL_MEMBER!>override<!> fun name(): String = "lol"
<!OVERRIDING_FINAL_MEMBER!>override<!> fun ordinal(): Int = 0
<!OVERRIDING_FINAL_MEMBER!>override<!> fun equals(other: Any?) = true
<!OVERRIDING_FINAL_MEMBER!>override<!> fun hashCode() = -1
}