JVM_IR pass reified type parameters in indy SAM conversion proxy
This commit is contained in:
committed by
teamcityserver
parent
40fe67880b
commit
005d3b1f6f
+5
-1
@@ -332,7 +332,7 @@ internal class FunctionReferenceLowering(private val context: JvmBackendContext)
|
||||
}
|
||||
|
||||
val proxyFun = context.irFactory.buildFun {
|
||||
name = Name.identifier("\$proxy")
|
||||
name = Name.identifier("${targetFun.name.asString()}__proxy")
|
||||
returnType = targetFun.returnType
|
||||
visibility = DescriptorVisibilities.LOCAL
|
||||
modality = Modality.FINAL
|
||||
@@ -395,6 +395,10 @@ internal class FunctionReferenceLowering(private val context: JvmBackendContext)
|
||||
)
|
||||
}
|
||||
|
||||
for (typeParameterIndex in targetFun.typeParameters.indices) {
|
||||
targetCall.putTypeArgument(typeParameterIndex, reference.getTypeArgument(typeParameterIndex))
|
||||
}
|
||||
|
||||
val proxyFunBody = IrBlockBodyImpl(startOffset, endOffset).also { proxyFun.body = it }
|
||||
when {
|
||||
targetFun.isArrayOf() -> {
|
||||
|
||||
+1
-2
@@ -132,8 +132,7 @@ internal class LambdaMetafactoryArgumentsBuilder(
|
||||
val implFun = reference.symbol.owner
|
||||
|
||||
if (implFun.typeParameters.any { it.isReified }) {
|
||||
// TODO support reified type parameters in proxy wrappers somehow?
|
||||
abiHazard = true
|
||||
functionHazard = true
|
||||
}
|
||||
|
||||
// Don't generate references to intrinsic functions as invokedynamic (no such method exists at run-time).
|
||||
|
||||
Reference in New Issue
Block a user