Remove redundant upcast in JvmPropertiesLowering
#KT-48621 Fixed
This commit is contained in:
committed by
TeamCityServer
parent
6f954462d6
commit
20ddaa9ebf
+3
-1
@@ -29,6 +29,7 @@ import org.jetbrains.kotlin.ir.expressions.IrFieldAccessExpression
|
||||
import org.jetbrains.kotlin.ir.expressions.impl.IrBlockBodyImpl
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
import org.jetbrains.kotlin.ir.types.classifierOrNull
|
||||
import org.jetbrains.kotlin.ir.types.isSubtypeOfClass
|
||||
import org.jetbrains.kotlin.ir.types.makeNotNull
|
||||
import org.jetbrains.kotlin.ir.util.*
|
||||
import org.jetbrains.kotlin.ir.visitors.transformChildrenVoid
|
||||
@@ -118,7 +119,8 @@ class JvmPropertiesLowering(private val backendContext: JvmBackendContext) : IrE
|
||||
val receiver = expression.dispatchReceiver
|
||||
if (receiver != null) {
|
||||
val propertyParent = irProperty.parent
|
||||
if (propertyParent is IrClass && propertyParent.symbol != receiver.type.classifierOrNull &&
|
||||
if (propertyParent is IrClass &&
|
||||
receiver.type.classifierOrNull?.isSubtypeOfClass(propertyParent.symbol) != true &&
|
||||
expression.superQualifierSymbol == null
|
||||
) {
|
||||
return irImplicitCast(receiver, propertyParent.defaultType)
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// - FIR2IR should generate call to fake override
|
||||
|
||||
// WITH_RUNTIME
|
||||
// FILE: 1.kt
|
||||
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// - FIR2IR should generate call to fake override
|
||||
|
||||
// WITH_RUNTIME
|
||||
// FILE: 1.kt
|
||||
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// WITH_RUNTIME
|
||||
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// - FIR2IR should generate call to fake override
|
||||
|
||||
// FILE: A.kt
|
||||
package a
|
||||
import b.*
|
||||
|
||||
-3
@@ -1,9 +1,6 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// WITH_RUNTIME
|
||||
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// - FIR2IR should generate call to fake override
|
||||
|
||||
// FILE: a.kt
|
||||
package a
|
||||
|
||||
|
||||
-3
@@ -1,9 +1,6 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// WITH_RUNTIME
|
||||
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// - FIR2IR should generate call to fake override
|
||||
|
||||
// FILE: a.kt
|
||||
package a
|
||||
|
||||
|
||||
Reference in New Issue
Block a user