92457543bc
* Generate simple check when compare with `null` literal. * Use Kotlin.equals if type of receiver or argument is nullable. * Don't call equals method if any of receiver or argument is null (at runtime, not only literal). For more information see KT-4356. #KT-7530 fixed #KT-7916 fixed
17 lines
256 B
Kotlin
Vendored
17 lines
256 B
Kotlin
Vendored
package foo
|
|
|
|
class A {
|
|
override fun equals(other: Any?) = super.equals(other)
|
|
}
|
|
|
|
fun box(): String {
|
|
val a: A? = null
|
|
|
|
testTrue { a == null }
|
|
testFalse { a != null }
|
|
testTrue { null == a }
|
|
testFalse { null != a }
|
|
|
|
return "OK"
|
|
}
|