From 60c4eb68ff4904782317d1ca4e597b3f213a4f80 Mon Sep 17 00:00:00 2001 From: "victor.petukhov" Date: Thu, 18 Jul 2019 13:37:18 +0300 Subject: [PATCH] Add condition for `checkNonParenthesizedAnnotationsOnFunctionalType` call to except error reporting in stub mode --- .../frontend/src/org/jetbrains/kotlin/resolve/TypeResolver.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/TypeResolver.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/TypeResolver.kt index 5eb141aba46..ba3f5949f5c 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/TypeResolver.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/TypeResolver.kt @@ -177,7 +177,8 @@ class TypeResolver( else -> null } - if (targetType is KtFunctionType && annotationEntries != null) { + // `targetType.stub == null` means that we don't apply this check for files that are built with stubs (that aren't opened in IDE and not in compile time) + if (targetType is KtFunctionType && targetType.stub == null && annotationEntries != null) { checkNonParenthesizedAnnotationsOnFunctionalType(targetType, annotationEntries, c.trace) } }