Fix equals check in interpreter in case when object is wrapped as Proxy

This commit is contained in:
Ivan Kylchik
2021-06-23 14:23:39 +03:00
committed by TeamCityServer
parent b9decc3b30
commit 668bb4fd71
3 changed files with 25 additions and 3 deletions
+13
View File
@@ -1,5 +1,18 @@
import kotlin.collections.*
@CompileTimeCalculation
class A(val a: Int) {
override fun equals(other: Any?): Boolean {
return other is Int && other == a
}
}
const val customEquals1 = <!EVALUATED: `true`!>A(1) == 1<!>
const val customEquals2 = <!EVALUATED: `false`!>A(1) == 123<!>
const val customEquals3 = <!EVALUATED: `false`!>1 == A(1)<!>
const val customEquals4 = <!EVALUATED: `false`!>123 == A(1)<!>
const val customEquals5 = <!EVALUATED: `false`!>null == A(1)<!>
const val customEquals6 = <!EVALUATED: `false`!>A(1) == null<!>
@CompileTimeCalculation
class B(val b: Int) {
override fun equals(other: Any?): Boolean {