mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-16 15:53:55 +00:00
16 lines
399 B
Kotlin
Vendored
16 lines
399 B
Kotlin
Vendored
// IGNORE_BACKEND: JS_IR
|
|
// IGNORE_BACKEND: JVM_IR
|
|
// LANGUAGE_VERSION: 1.0
|
|
|
|
data class Foo(val s: String)
|
|
|
|
fun box(): String {
|
|
val f1 = Foo("OK")
|
|
val f2 = Foo("OK")
|
|
if (f1 != f2) return "Fail equals"
|
|
if (f1.hashCode() != f2.hashCode()) return "Fail hashCode"
|
|
if (f1.toString() != f2.toString() || f1.toString() != "Foo(s=OK)") return "Fail toString: $f1 $f2"
|
|
|
|
return f1.s
|
|
}
|