From 98aadc03b7e299a1a7c1e5c5bf0c02d85efe8c7d Mon Sep 17 00:00:00 2001 From: Him188 Date: Sat, 10 Apr 2021 20:18:14 +0800 Subject: [PATCH] IDE: Ignore exceptions on resolve --- tools/intellij-plugin/src/resolve/resolveIdea.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/intellij-plugin/src/resolve/resolveIdea.kt b/tools/intellij-plugin/src/resolve/resolveIdea.kt index b1df5bb09..0920783c7 100644 --- a/tools/intellij-plugin/src/resolve/resolveIdea.kt +++ b/tools/intellij-plugin/src/resolve/resolveIdea.kt @@ -41,7 +41,6 @@ import org.jetbrains.kotlin.resolve.lazy.BodyResolveMode import org.jetbrains.kotlin.types.KotlinType import org.jetbrains.kotlin.types.TypeProjection import org.jetbrains.kotlin.types.typeUtil.supertypes -import org.jetbrains.kotlin.utils.KotlinExceptionWithAttachments import org.jetbrains.kotlin.utils.addToStdlib.firstIsInstance @@ -140,7 +139,7 @@ val KtAnnotationEntry.annotationClass: KtClass? get() = calleeExpression?.constructorReferenceExpression?.run { try { resolve() - } catch (e: KotlinExceptionWithAttachments) { + } catch (e: Exception) { null // type inference with `by lazy {}` is unstable for now. I just ignore exceptions encountering with such issue. } }?.findParent()