Convert reference to lambda: protect from root fq name EA-114907 Fixed

This commit is contained in:
Mikhail Glukhikh
2018-01-18 17:48:21 +03:00
parent 3c19af3645
commit f675d9fd81
@@ -135,7 +135,7 @@ class ConvertReferenceToLambdaIntention : SelfTargetingOffsetIndependentIntentio
val expectedType = context[BindingContext.EXPECTED_EXPRESSION_TYPE, element] ?: return true
val expectedTypeDescriptor = expectedType.constructor.declarationDescriptor as? ClassDescriptor ?: return true
val expectedTypeFqName = expectedTypeDescriptor.fqNameSafe
return expectedTypeFqName.parent() != KOTLIN_REFLECT_FQ_NAME
return expectedTypeFqName.isRoot || expectedTypeFqName.parent() != KOTLIN_REFLECT_FQ_NAME
}
companion object {