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) } }