From dc51a268aa00fe6670448cb1afef6bfc63d0d7c9 Mon Sep 17 00:00:00 2001 From: Dmitry Gridin Date: Fri, 3 Apr 2020 14:06:53 +0700 Subject: [PATCH] ReplaceWithAnnotationAnalyzer: should throw `ControlFlowException` --- .../idea/quickfix/replaceWith/ReplaceWithAnnotationAnalyzer.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/idea/src/org/jetbrains/kotlin/idea/quickfix/replaceWith/ReplaceWithAnnotationAnalyzer.kt b/idea/src/org/jetbrains/kotlin/idea/quickfix/replaceWith/ReplaceWithAnnotationAnalyzer.kt index 08027d9c9b2..9954dff28ff 100644 --- a/idea/src/org/jetbrains/kotlin/idea/quickfix/replaceWith/ReplaceWithAnnotationAnalyzer.kt +++ b/idea/src/org/jetbrains/kotlin/idea/quickfix/replaceWith/ReplaceWithAnnotationAnalyzer.kt @@ -5,6 +5,7 @@ package org.jetbrains.kotlin.idea.quickfix.replaceWith +import com.intellij.openapi.diagnostic.ControlFlowException import org.jetbrains.kotlin.config.LanguageVersionSettings import org.jetbrains.kotlin.descriptors.* import org.jetbrains.kotlin.idea.analysis.analyzeInContext @@ -59,6 +60,7 @@ object ReplaceWithAnnotationAnalyzer { val expression = try { psiFactory.createExpression(annotation.pattern) } catch (t: Throwable) { + if (t is ControlFlowException) throw t return null } @@ -82,6 +84,7 @@ object ReplaceWithAnnotationAnalyzer { val typeReference = try { psiFactory.createType(annotation.pattern) } catch (e: Exception) { + if (e is ControlFlowException) throw e return null } if (typeReference.typeElement !is KtUserType) return null