JVM_IR indy-SAM conversions: minor updates
See: KT-44575 KT-44577 KT-44278 KT-26060 KT-42621
This commit is contained in:
+5
-9
@@ -13,7 +13,6 @@ import org.jetbrains.kotlin.backend.common.lower.parents
|
||||
import org.jetbrains.kotlin.backend.common.phaser.makeIrFilePhase
|
||||
import org.jetbrains.kotlin.backend.jvm.JvmBackendContext
|
||||
import org.jetbrains.kotlin.backend.jvm.JvmLoweredDeclarationOrigin
|
||||
import org.jetbrains.kotlin.backend.jvm.codegen.representativeUpperBound
|
||||
import org.jetbrains.kotlin.backend.jvm.ir.*
|
||||
import org.jetbrains.kotlin.backend.jvm.lower.inlineclasses.InlineClassAbi
|
||||
import org.jetbrains.kotlin.config.JvmSamConversions
|
||||
@@ -170,15 +169,12 @@ internal class FunctionReferenceLowering(private val context: JvmBackendContext)
|
||||
private fun IrType.isProhibitedTypeForIndySamConversion(): Boolean {
|
||||
if (this !is IrSimpleType) return false
|
||||
|
||||
val erasedType = when (val classifier = classifier.owner) {
|
||||
is IrTypeParameter ->
|
||||
classifier.representativeUpperBound.withHasQuestionMark(hasQuestionMark)
|
||||
else ->
|
||||
this
|
||||
val erasedClass = when (val classifier = classifier.owner) {
|
||||
is IrTypeParameter -> classifier.erasedUpperBound
|
||||
is IrClass -> classifier
|
||||
else -> throw AssertionError("Unexpected classifier: ${classifier.render()}")
|
||||
}
|
||||
val erasedClass = erasedType.getClass() ?: return false
|
||||
|
||||
if (!erasedType.isInlined()) return false
|
||||
if (!erasedClass.isInline) return false
|
||||
|
||||
val underlyingType = getInlineClassUnderlyingType(erasedClass) as? IrSimpleType
|
||||
?: throw AssertionError("Underlying type for inline class should be a simple type: ${erasedClass.render()}")
|
||||
|
||||
Reference in New Issue
Block a user