[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
@@ -1,11 +1,11 @@
// FIR_IDENTICAL
// WITH_STDLIB
// !DIAGNOSTICS: -DEBUG_INFO_SMARTCAST
// LANGUAGE: +CustomEqualsInInlineClasses
// LANGUAGE: +CustomEqualsInValueClasses
@JvmInline
value class IC1(val x: Int) {
override fun <!INEFFICIENT_EQUALS_OVERRIDING_IN_INLINE_CLASS!>equals<!>(other: Any?): Boolean {
override fun <!INEFFICIENT_EQUALS_OVERRIDING_IN_VALUE_CLASS!>equals<!>(other: Any?): Boolean {
if (other !is IC1) {
return false
}
@@ -29,9 +29,9 @@ value class IC3(val x: Int) {
@JvmInline
value class IC4<T>(val x: Int) {
override fun <!INEFFICIENT_EQUALS_OVERRIDING_IN_INLINE_CLASS!>equals<!>(other: Any?) = true
override fun equals(other: Any?) = true
fun equals(other: IC4<T>) = true
fun equals(other: <!TYPE_ARGUMENT_ON_TYPED_VALUE_CLASS_EQUALS!>IC4<T><!>) = true
override fun hashCode() = 0
}
}