K1: drop redundant OptIn check for expanded type

This commit is contained in:
Mikhail Glukhikh
2022-07-12 13:50:52 +02:00
committed by teamcity
parent 3f96626b40
commit 84291181af
@@ -417,15 +417,7 @@ class OptInUsageChecker(project: Project) : CallChecker {
}
if (element.getParentOfType<KtImportDirective>(false) == null) {
val descriptions = mutableSetOf<OptInDescription>()
descriptions += targetDescriptor.loadOptIns(moduleAnnotationsResolver, context.languageVersionSettings)
if (targetDescriptor is TypeAliasDescriptor) {
descriptions.addAll(
targetDescriptor.expandedType.loadOptIns(
moduleAnnotationsResolver, context.languageVersionSettings, mutableSetOf(targetDescriptor)
)
)
}
val descriptions = targetDescriptor.loadOptIns(moduleAnnotationsResolver, context.languageVersionSettings)
reportNotAllowedOptIns(descriptions, element, context)
}
}