FIR2IR: generate synthetic members for data class only if needed

This commit is contained in:
Jinseong Jeon
2020-04-14 10:40:16 -07:00
committed by Mikhail Glukhikh
parent acced52384
commit 07add635eb
9 changed files with 150 additions and 51 deletions
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
data class A(val x: Int) {
override fun equals(other: Any?): Boolean = false
}
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// TARGET_BACKEND: JVM
// WITH_RUNTIME
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
data class A(val x: Int) {
override fun hashCode(): Int = -3
}
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
abstract class Base {
final override fun toString() = "OK"
final override fun hashCode() = 42
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
data class A(val x: Int) {
override fun toString(): String = "!"
}