K2: Added test for data class metadata

#KT-57622 Fixed
This commit is contained in:
Pavel Kunyavskiy
2023-04-18 14:36:46 +02:00
committed by Space Team
parent f48142a6e6
commit f67f8c393b
20 changed files with 146 additions and 0 deletions
@@ -0,0 +1,19 @@
// MODULE: lib
// FILE: lib.kt
data class D(val x: Int)
// MODULE: main(lib)
// FILE: main.kt
fun box() : String {
val a = D(1)
val b = D(2)
val c = D(1)
if (a == b) return "FAIL 1"
if (a != c) return "FAIL 2"
if (!a.equals(c)) return "FAIL 3"
if (a.hashCode() != c.hashCode()) return "FAIL 4"
return "OK"
}