toString() method for data classes and fake implementation for hashCode/equals
This commit is contained in:
@@ -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"
|
||||
}
|
||||
Reference in New Issue
Block a user