Files
kotlin-fork/js/js.translator/testFiles/expression/equals/cases/customEqualsMethod.kt
T
2012-07-03 13:55:49 +01:00

18 lines
294 B
Kotlin

package foo
class Foo(val name: String) {
public fun equals(that: Foo): Boolean {
return this.name == that.name
}
}
fun box() : Boolean {
val a = Foo("abc")
val b = Foo("abc")
val c = Foo("def")
if (a != b) return false
if (a == c) return false
return true
}