* Enabled inlining of stdlib
* Fixed two bugs in inlining
This commit is contained in:
+1
-1
@@ -271,7 +271,7 @@ internal class DeepCopyIrTreeWithDescriptors(val targetFunction: IrFunction, val
|
||||
if (irCall !is IrCallImpl) return irCall // TODO what other kinds of call can we meet?
|
||||
|
||||
val oldDescriptor = irCall.descriptor
|
||||
val newDescriptor = descriptorSubstituteMap.getOrDefault(oldDescriptor,
|
||||
val newDescriptor = descriptorSubstituteMap.getOrDefault(oldDescriptor.original,
|
||||
oldDescriptor) as FunctionDescriptor
|
||||
|
||||
val oldSuperQualifier = irCall.superQualifier
|
||||
|
||||
+2
-4
@@ -85,9 +85,6 @@ internal class FunctionInlining(val context: Context): IrElementTransformerVoid(
|
||||
|
||||
override fun visitCall(expression: IrCall): IrExpression {
|
||||
|
||||
val fqName = currentFile!!.packageFragmentDescriptor.fqName.asString() // TODO to be removed after stdlib compilation
|
||||
if(fqName.contains("kotlin")) return super.visitCall(expression) // TODO to be removed after stdlib compilation
|
||||
|
||||
val irCall = super.visitCall(expression) as IrCall
|
||||
|
||||
val functionDescriptor = irCall.descriptor as FunctionDescriptor
|
||||
@@ -271,7 +268,8 @@ internal class FunctionInlining(val context: Context): IrElementTransformerVoid(
|
||||
val operandTypeDescriptor = newExpression.typeOperand.constructor.declarationDescriptor
|
||||
if (operandTypeDescriptor !is TypeParameterDescriptor) return newExpression // It is not TypeParameter - do nothing
|
||||
|
||||
var typeNew = typeArgsMap[operandTypeDescriptor]!!
|
||||
var typeNew = typeArgsMap[operandTypeDescriptor]
|
||||
?: return expression
|
||||
if (newExpression.typeOperand.isMarkedNullable)
|
||||
typeNew = typeNew.makeNullable()
|
||||
val startOffset = newExpression.startOffset
|
||||
|
||||
Reference in New Issue
Block a user