Descriptor return type must coincide with expression return type
This commit is contained in:
committed by
KonstantinAnisimov
parent
5920e0d8ba
commit
0f24850f3c
+9
-6
@@ -383,11 +383,12 @@ internal class DeepCopyIrTreeWithDescriptors(val targetDescriptor: DeclarationDe
|
|||||||
|
|
||||||
override fun visitCall(expression: IrCall): IrCall {
|
override fun visitCall(expression: IrCall): IrCall {
|
||||||
if (expression !is IrCallImpl) return super.visitCall(expression)
|
if (expression !is IrCallImpl) return super.visitCall(expression)
|
||||||
|
val newDescriptor = mapCallee(expression.descriptor)
|
||||||
return IrCallImpl(
|
return IrCallImpl(
|
||||||
startOffset = expression.startOffset,
|
startOffset = expression.startOffset,
|
||||||
endOffset = expression.endOffset,
|
endOffset = expression.endOffset,
|
||||||
type = substituteType(expression.type)!!,
|
type = newDescriptor.returnType!!,
|
||||||
descriptor = mapCallee(expression.descriptor),
|
descriptor = newDescriptor,
|
||||||
typeArguments = substituteTypeArguments(expression.getTypeArgumentsMap()),
|
typeArguments = substituteTypeArguments(expression.getTypeArgumentsMap()),
|
||||||
origin = expression.origin,
|
origin = expression.origin,
|
||||||
superQualifier = mapSuperQualifier(expression.superQualifier)
|
superQualifier = mapSuperQualifier(expression.superQualifier)
|
||||||
@@ -419,15 +420,17 @@ internal class DeepCopyIrTreeWithDescriptors(val targetDescriptor: DeclarationDe
|
|||||||
|
|
||||||
//---------------------------------------------------------------------//
|
//---------------------------------------------------------------------//
|
||||||
|
|
||||||
override fun visitCallableReference(expression: IrCallableReference): IrCallableReference =
|
override fun visitCallableReference(expression: IrCallableReference): IrCallableReference {
|
||||||
IrCallableReferenceImpl(
|
val newDescriptor = mapCallableReference(expression.descriptor)
|
||||||
|
return IrCallableReferenceImpl(
|
||||||
startOffset = expression.startOffset,
|
startOffset = expression.startOffset,
|
||||||
endOffset = expression.endOffset,
|
endOffset = expression.endOffset,
|
||||||
type = substituteType(expression.type)!!,
|
type = newDescriptor.returnType!!,
|
||||||
descriptor = mapCallableReference(expression.descriptor),
|
descriptor = newDescriptor,
|
||||||
typeArguments = expression.getTypeArgumentsMap(),
|
typeArguments = expression.getTypeArgumentsMap(),
|
||||||
origin = mapStatementOrigin(expression.origin)
|
origin = mapStatementOrigin(expression.origin)
|
||||||
).transformValueArguments(expression)
|
).transformValueArguments(expression)
|
||||||
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------//
|
//---------------------------------------------------------------------//
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user