Fix EA-125880

This commit is contained in:
Mikhail Glukhikh
2018-12-27 20:10:05 +03:00
parent 8de2ff2163
commit ed8d9be483
@@ -49,7 +49,7 @@ class ChangeFunctionLiteralReturnTypeFix(
private fun createAppropriateQuickFix(functionLiteralExpression: KtLambdaExpression, type: KotlinType): IntentionAction? {
val context = functionLiteralExpression.analyze()
val functionLiteralType = context.getType(functionLiteralExpression) ?: error("Type of function literal not available in binding context")
val functionLiteralType = context.getType(functionLiteralExpression) ?: return null
val builtIns = functionLiteralType.constructor.builtIns
val functionClass = builtIns.getFunction(functionLiteralType.arguments.size - 1)