OptInUsageChecker: restore public API isOptInAllowed method

This commit is contained in:
Mikhail Glukhikh
2022-08-11 08:51:19 +02:00
committed by teamcity
parent 81e1131441
commit cb1123cccd
2 changed files with 7 additions and 3 deletions
@@ -324,6 +324,12 @@ class OptInUsageChecker(project: Project) : CallChecker {
* annotated with `@X` where [annotationFqName] is the FQ name of X
*/
fun PsiElement.isOptInAllowed(
annotationFqName: FqName,
languageVersionSettings: LanguageVersionSettings,
bindingContext: BindingContext
): Boolean = isOptInAllowed(annotationFqName, languageVersionSettings, bindingContext, subclassesOnly = false)
private fun PsiElement.isOptInAllowed(
annotationFqName: FqName,
languageVersionSettings: LanguageVersionSettings,
bindingContext: BindingContext,
@@ -117,9 +117,7 @@ class DeprecationResolver(
return if (callElement != null && bindingContext != null) {
with(OptInUsageChecker) {
sinceKotlinAccessibility.markerClasses.any { classDescriptor ->
!callElement.isOptInAllowed(
classDescriptor.fqNameSafe, languageVersionSettings, bindingContext, subclassesOnly = false
)
!callElement.isOptInAllowed(classDescriptor.fqNameSafe, languageVersionSettings, bindingContext)
}
}
} else {