JVM_IR: fix primitive comparison optimizations
1. the `primitive == object?.something` fusion should not apply to
`primitive.equals(object?.something)` because it can't;
2. coercions to Int are there for a reason - don't remove them;
3. better optimize `primitive == object?.something` -- the result
should be subject to if-null fusion, so it needs to have a specific
pattern that resembles safe calls.
#KT-47597 Fixed
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
class C(val x: Short)
|
||||
|
||||
fun box(): String {
|
||||
val a: C = C(1)
|
||||
val b: C? = C(1)
|
||||
return if (b?.x == a.x) "OK" else "fail"
|
||||
}
|
||||
Reference in New Issue
Block a user