Make type parameter nullable as it should be
This change is needed, because in NI we perform a more strict check
This commit is contained in:
@@ -85,7 +85,7 @@ open class InliningContext(
|
|||||||
|
|
||||||
fun subInlineWithClassRegeneration(
|
fun subInlineWithClassRegeneration(
|
||||||
generator: NameGenerator,
|
generator: NameGenerator,
|
||||||
newTypeMappings: MutableMap<String, String>,
|
newTypeMappings: MutableMap<String, String?>,
|
||||||
callSiteInfo: InlineCallSiteInfo
|
callSiteInfo: InlineCallSiteInfo
|
||||||
): InliningContext = RegeneratedClassContext(
|
): InliningContext = RegeneratedClassContext(
|
||||||
this, expressionMap, state, generator, TypeRemapper.createFrom(typeRemapper, newTypeMappings),
|
this, expressionMap, state, generator, TypeRemapper.createFrom(typeRemapper, newTypeMappings),
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ class MethodInliner(
|
|||||||
//keeps order
|
//keeps order
|
||||||
private val transformations = ArrayList<TransformationInfo>()
|
private val transformations = ArrayList<TransformationInfo>()
|
||||||
//current state
|
//current state
|
||||||
private val currentTypeMapping = HashMap<String, String>()
|
private val currentTypeMapping = HashMap<String, String?>()
|
||||||
private val result = InlineResult.create()
|
private val result = InlineResult.create()
|
||||||
private var lambdasFinallyBlocks: Int = 0
|
private var lambdasFinallyBlocks: Int = 0
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class TypeParameter(val oldName: String, val newName: String?, val isReified: Bo
|
|||||||
|
|
||||||
//typeMapping data could be changed outside through method processing
|
//typeMapping data could be changed outside through method processing
|
||||||
class TypeRemapper private constructor(
|
class TypeRemapper private constructor(
|
||||||
private val typeMapping: MutableMap<String, String>,
|
private val typeMapping: MutableMap<String, String?>,
|
||||||
val parent: TypeRemapper? = null,
|
val parent: TypeRemapper? = null,
|
||||||
private val isRootInlineLambda: Boolean = false
|
private val isRootInlineLambda: Boolean = false
|
||||||
) {
|
) {
|
||||||
@@ -65,7 +65,7 @@ class TypeRemapper private constructor(
|
|||||||
companion object {
|
companion object {
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun createRoot(formalTypeParameters: TypeParameterMappings?): TypeRemapper {
|
fun createRoot(formalTypeParameters: TypeParameterMappings?): TypeRemapper {
|
||||||
return TypeRemapper(HashMap<String, String>()).apply {
|
return TypeRemapper(HashMap<String, String?>()).apply {
|
||||||
formalTypeParameters?.forEach {
|
formalTypeParameters?.forEach {
|
||||||
registerTypeParameter(it)
|
registerTypeParameter(it)
|
||||||
}
|
}
|
||||||
@@ -73,7 +73,7 @@ class TypeRemapper private constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun createFrom(mappings: MutableMap<String, String>): TypeRemapper {
|
fun createFrom(mappings: MutableMap<String, String?>): TypeRemapper {
|
||||||
return TypeRemapper(mappings)
|
return TypeRemapper(mappings)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,7 +83,7 @@ class TypeRemapper private constructor(
|
|||||||
return TypeRemapper(createNewAndMerge(parentRemapper, mappings), parentRemapper, isRootInlineLambda)
|
return TypeRemapper(createNewAndMerge(parentRemapper, mappings), parentRemapper, isRootInlineLambda)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun createNewAndMerge(remapper: TypeRemapper, additionalTypeMappings: Map<String, String?>): MutableMap<String, String> {
|
private fun createNewAndMerge(remapper: TypeRemapper, additionalTypeMappings: Map<String, String?>): MutableMap<String, String?> {
|
||||||
return HashMap(remapper.typeMapping).apply {
|
return HashMap(remapper.typeMapping).apply {
|
||||||
this += additionalTypeMappings
|
this += additionalTypeMappings
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user