Custom equals operator (includes little patch to frontend)

#KT-2354 fixed
This commit is contained in:
Pavel V. Talanov
2012-07-05 15:32:57 +04:00
parent 88a38d9b5b
commit 6354d1bae0
5 changed files with 24 additions and 19 deletions
@@ -1,9 +1,12 @@
package foo
class Foo(val name: String) {
public fun equals(that: Foo): Boolean {
return this.name == that.name
}
public fun equals(that: Any?): Boolean {
if (that !is Foo) {
return false
}
return this.name == that.name
}
}
fun box() : Boolean {