[JS IR] Clean up callable reference lowering
This commit is contained in:
+2
-5
@@ -105,14 +105,13 @@ class CallableReferenceLowering(private val context: CommonBackendContext) : Bod
|
|||||||
private val isLambda: Boolean
|
private val isLambda: Boolean
|
||||||
) {
|
) {
|
||||||
|
|
||||||
private val isKReference: Boolean get() = superFunctionInterface.name.identifier[0] == 'K'
|
|
||||||
|
|
||||||
private val isSuspendLambda = isLambda && function.isSuspend
|
private val isSuspendLambda = isLambda && function.isSuspend
|
||||||
private val superClass = if (isSuspendLambda) context.ir.symbols.coroutineImpl.owner.defaultType else context.irBuiltIns.anyType
|
|
||||||
|
|
||||||
|
private val superClass = if (isSuspendLambda) context.ir.symbols.coroutineImpl.owner.defaultType else context.irBuiltIns.anyType
|
||||||
private var boundReceiverField: IrField? = null
|
private var boundReceiverField: IrField? = null
|
||||||
|
|
||||||
private val superFunctionInterface = reference.type.classOrNull?.owner ?: error("Expected functional type")
|
private val superFunctionInterface = reference.type.classOrNull?.owner ?: error("Expected functional type")
|
||||||
|
private val isKReference = superFunctionInterface.name.identifier[0] == 'K'
|
||||||
|
|
||||||
private fun buildReferenceClass(): IrClass {
|
private fun buildReferenceClass(): IrClass {
|
||||||
return buildClass {
|
return buildClass {
|
||||||
@@ -303,8 +302,6 @@ class CallableReferenceLowering(private val context: CommonBackendContext) : Bod
|
|||||||
private fun createNameProperty(clazz: IrClass) {
|
private fun createNameProperty(clazz: IrClass) {
|
||||||
if (!isKReference) return
|
if (!isKReference) return
|
||||||
|
|
||||||
// if (superFunctionInterface.name.identifier[0] != 'K') return
|
|
||||||
|
|
||||||
val superProperty = superFunctionInterface.declarations.filterIsInstance<IrProperty>().single()
|
val superProperty = superFunctionInterface.declarations.filterIsInstance<IrProperty>().single()
|
||||||
val supperGetter = superProperty.getter ?: error("Expected getter for KFunction.name property")
|
val supperGetter = superProperty.getter ?: error("Expected getter for KFunction.name property")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user