mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-10 18:40:15 +08:00
IDE: Ignore exceptions on resolve
This commit is contained in:
parent
dc5e89518e
commit
98aadc03b7
@ -41,7 +41,6 @@ import org.jetbrains.kotlin.resolve.lazy.BodyResolveMode
|
|||||||
import org.jetbrains.kotlin.types.KotlinType
|
import org.jetbrains.kotlin.types.KotlinType
|
||||||
import org.jetbrains.kotlin.types.TypeProjection
|
import org.jetbrains.kotlin.types.TypeProjection
|
||||||
import org.jetbrains.kotlin.types.typeUtil.supertypes
|
import org.jetbrains.kotlin.types.typeUtil.supertypes
|
||||||
import org.jetbrains.kotlin.utils.KotlinExceptionWithAttachments
|
|
||||||
import org.jetbrains.kotlin.utils.addToStdlib.firstIsInstance
|
import org.jetbrains.kotlin.utils.addToStdlib.firstIsInstance
|
||||||
|
|
||||||
|
|
||||||
@ -140,7 +139,7 @@ val KtAnnotationEntry.annotationClass: KtClass?
|
|||||||
get() = calleeExpression?.constructorReferenceExpression?.run {
|
get() = calleeExpression?.constructorReferenceExpression?.run {
|
||||||
try {
|
try {
|
||||||
resolve()
|
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.
|
null // type inference with `by lazy {}` is unstable for now. I just ignore exceptions encountering with such issue.
|
||||||
}
|
}
|
||||||
}?.findParent<KtClass>()
|
}?.findParent<KtClass>()
|
||||||
|
Loading…
Reference in New Issue
Block a user