Callable reference type does not coincides with descriptor return type
Callable reference should be excluded from parameter evaluation procedure
This commit is contained in:
committed by
KonstantinAnisimov
parent
7bf9669f57
commit
8db33dd530
+1
-1
@@ -425,7 +425,7 @@ internal class DeepCopyIrTreeWithDescriptors(val targetDescriptor: DeclarationDe
|
||||
return IrCallableReferenceImpl(
|
||||
startOffset = expression.startOffset,
|
||||
endOffset = expression.endOffset,
|
||||
type = newDescriptor.returnType!!,
|
||||
type = expression.type,
|
||||
descriptor = newDescriptor,
|
||||
typeArguments = expression.getTypeArgumentsMap(),
|
||||
origin = mapStatementOrigin(expression.origin)
|
||||
|
||||
+1
@@ -217,6 +217,7 @@ private class Inliner(val currentScope: ScopeWithIr, val context: Context) {
|
||||
private fun argumentNeedsEvaluation(expression: IrExpression): Boolean {
|
||||
if (expression is IrGetValue) return false // Parameter is already GetValue - nothing to evaluate.
|
||||
if (expression is IrConst<*>) return false // Parameter is constant - nothing to evaluate.
|
||||
if (expression is IrCallableReference) return false // Parameter is callable reference - nothing to evaluate.
|
||||
if (isLambdaExpression(expression)) return false // Parameter is lambda - will be inlined.
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user