Make enum classes comparable

#KT-3727 Fixed
This commit is contained in:
Alexander Udalov
2014-10-16 20:42:40 +04:00
parent 02861308bc
commit 624e507ec2
10 changed files with 88 additions and 14 deletions
+9
View File
@@ -292,6 +292,15 @@
ordinal: function () {
return this.ordinal$;
},
equals_za3rmp$: function (o) {
return this === o;
},
hashCode: function () {
return getObjectHashCode(this);
},
compareTo_za3rmp$: function (o) {
return this.ordinal$ < o.ordinal$ ? -1 : this.ordinal$ > o.ordinal$ ? 1 : 0;
},
toString: function () {
return this.name();
}