From f675d9fd81f9026970b4ad888d3a99b042b83afc Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Thu, 18 Jan 2018 17:48:21 +0300 Subject: [PATCH] Convert reference to lambda: protect from root fq name EA-114907 Fixed --- .../kotlin/idea/intentions/ConvertReferenceToLambdaIntention.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/idea/src/org/jetbrains/kotlin/idea/intentions/ConvertReferenceToLambdaIntention.kt b/idea/src/org/jetbrains/kotlin/idea/intentions/ConvertReferenceToLambdaIntention.kt index 5edc40001c8..d0d11df2ca0 100644 --- a/idea/src/org/jetbrains/kotlin/idea/intentions/ConvertReferenceToLambdaIntention.kt +++ b/idea/src/org/jetbrains/kotlin/idea/intentions/ConvertReferenceToLambdaIntention.kt @@ -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 {