JVM_IR KT-48945 generate special bridge with unsubstituted signature

This commit is contained in:
Dmitry Petrov
2021-11-15 15:51:28 +03:00
committed by TeamCityServer
parent 4c3404888a
commit 30ceb49442
36 changed files with 809 additions and 42 deletions
@@ -24,6 +24,7 @@ data class SpecialMethodWithDefaultInfo(
val defaultValueGenerator: (IrSimpleFunction) -> IrExpression,
val argumentsToCheck: Int,
val needsGenericSignature: Boolean = false,
val needsUnsubstitutedBridge: Boolean = false
)
class BuiltInWithDifferentJvmName(
@@ -78,11 +79,11 @@ class SpecialBridgeMethods(val context: CommonBackendContext) {
makeDescription(StandardNames.FqNames.list, "lastIndexOf", 1) to
SpecialMethodWithDefaultInfo(::constMinusOne, 1),
makeDescription(StandardNames.FqNames.map, "getOrDefault", 2) to
SpecialMethodWithDefaultInfo(::getSecondArg, 1, needsGenericSignature = true),
SpecialMethodWithDefaultInfo(::getSecondArg, 1, needsGenericSignature = true, needsUnsubstitutedBridge = true),
makeDescription(StandardNames.FqNames.map, "get", 1) to
SpecialMethodWithDefaultInfo(::constNull, 1, needsGenericSignature = true),
SpecialMethodWithDefaultInfo(::constNull, 1, needsGenericSignature = true, needsUnsubstitutedBridge = true),
makeDescription(StandardNames.FqNames.mutableMap, "remove", 1) to
SpecialMethodWithDefaultInfo(::constNull, 1, needsGenericSignature = true)
SpecialMethodWithDefaultInfo(::constNull, 1, needsGenericSignature = true, needsUnsubstitutedBridge = true)
)
private val specialProperties = mapOf(