Don't report EXPERIMENTAL_OVERRIDE_ERROR on annotated local functions

#KT-31728 Fixed
This commit is contained in:
Mikhail Glukhikh
2021-05-19 16:14:52 +03:00
committed by teamcityserver
parent cb232725f0
commit 7393465696
7 changed files with 65 additions and 2 deletions
@@ -214,8 +214,7 @@ class ExperimentalUsageChecker(project: Project) : CallChecker {
if (this !is KtDeclaration) return false
val descriptor = bindingContext.get(BindingContext.DECLARATION_TO_DESCRIPTOR, this)
return descriptor != null && !DescriptorUtils.isLocal(descriptor) &&
descriptor.annotations.hasAnnotation(annotationFqName)
return descriptor != null && descriptor.annotations.hasAnnotation(annotationFqName)
}
private fun PsiElement.isElementAnnotatedWithUseExperimentalOf(annotationFqName: FqName, bindingContext: BindingContext): Boolean {