Files
kotlin-fork/compiler/testData/codegen/box/controlStructures/kt1441.kt
T
Alexander Udalov 41a416da60 Move blackBoxFile() testData to box/ directory
Delete all test methods (and empty test classes), since they'll be
auto-generated
2013-01-28 18:20:17 +04:00

17 lines
380 B
Kotlin

class Foo {
var rnd = 10
public fun equals(that : Any) : Boolean = that is Foo && (that.rnd == rnd)
}
fun box() : String {
val a = Foo()
val b = Foo()
if (!a.identityEquals(a)) return "fail 1"
if (!b.identityEquals(b)) return "fail 2"
if (b.identityEquals(a)) return "fail 3"
if (a.identityEquals(b)) return "fail 4"
if( a !=b ) return "fail5"
return "OK"
}