Do not inline arguments that are IrBlock or IrCallableReference

This commit is contained in:
Igor Chevdar
2017-04-03 16:07:56 +03:00
parent d9e400f39e
commit b9507d9036
@@ -106,8 +106,6 @@ internal class FunctionInlining(val context: Context): IrElementTransformerVoid(
private fun needsEvaluation(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 CallableReference - nothing to evaluate.
if (expression is IrBlock) return false // Parameter is Block - nothing to evaluate.
if (isLambdaExpression(expression)) return false // Parameter is lambda - will be inlined.
return true
}