toString() method for data classes and fake implementation for hashCode/equals

This commit is contained in:
Alex Tkachman
2012-09-16 15:56:48 +03:00
parent e317764a88
commit 58af365eb2
13 changed files with 236 additions and 40 deletions
@@ -0,0 +1,11 @@
open data class A(open val x: String)
class B : A("OK") {
override val x: String = "Fail"
}
fun foo(a: A) = a
fun box(): String {
return if ("${foo(B())}" == "A{x=OK}") "OK" else "fail"
}