[IR] Support user-defined equals for MFVC

Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
This commit is contained in:
Evgeniy.Zhelenskiy
2022-10-14 07:17:03 +02:00
committed by Space Team
parent 51f9f31a0a
commit 9f01ccc304
75 changed files with 1686 additions and 315 deletions
@@ -42,8 +42,8 @@ FILE: inlineClassMembers.kt
}
}
public final inline class ReversedMembers : R|kotlin/Any| {
public constructor(x: R|kotlin/Int|): R|ReversedMembers| {
public final inline class ReservedMembers : R|kotlin/Any| {
public constructor(x: R|kotlin/Int|): R|ReservedMembers| {
super<R|kotlin/Any|>()
}
@@ -64,6 +64,32 @@ FILE: inlineClassMembers.kt
^hashCode Int(1)
}
}
public final inline class ReservedMembersMfvc : R|kotlin/Any| {
public constructor(x: R|kotlin/Int|, y: R|kotlin/Int|): R|ReservedMembersMfvc| {
super<R|kotlin/Any|>()
}
public final val x: R|kotlin/Int| = R|<local>/x|
public get(): R|kotlin/Int|
public final val y: R|kotlin/Int| = R|<local>/y|
public get(): R|kotlin/Int|
public final fun box(): R|kotlin/Unit| {
}
public final fun unbox(): R|kotlin/Unit| {
}
public final override operator fun equals(other: R|kotlin/Any?|): R|kotlin/Boolean| {
^equals Boolean(true)
}
public final override fun hashCode(): R|kotlin/Int| {
^hashCode Int(1)
}
}
public final inline class SecondaryConstructors : R|kotlin/Any| {
public constructor(x: R|kotlin/Int|): R|SecondaryConstructors| {
@@ -1,4 +1,4 @@
// !LANGUAGE: +CustomEqualsInInlineClasses
// !LANGUAGE: +CustomEqualsInValueClasses, +ValueClasses
<!VALUE_CLASS_WITHOUT_JVM_INLINE_ANNOTATION!>value<!> class BackingFields(val x: Int) {
<!PROPERTY_WITH_BACKING_FIELD_INSIDE_VALUE_CLASS!>val y<!> = 0
@@ -14,11 +14,19 @@ inline class DelegatedProp(val x: Int) {
val testVal by <!DELEGATED_PROPERTY_INSIDE_VALUE_CLASS!>Val()<!>
}
inline class ReversedMembers(val x: Int) {
inline class ReservedMembers(val x: Int) {
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>box<!>() {}
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>unbox<!>() {}
override fun <!INEFFICIENT_EQUALS_OVERRIDING_IN_INLINE_CLASS!>equals<!>(other: Any?) = true
override fun <!INEFFICIENT_EQUALS_OVERRIDING_IN_VALUE_CLASS!>equals<!>(other: Any?) = true
override fun hashCode() = 1
}
inline class ReservedMembersMfvc(val x: Int, val y: Int) {
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>box<!>() {}
fun <!RESERVED_MEMBER_INSIDE_VALUE_CLASS!>unbox<!>() {}
override fun <!INEFFICIENT_EQUALS_OVERRIDING_IN_VALUE_CLASS!>equals<!>(other: Any?) = true
override fun hashCode() = 1
}