Add/fix extra cases for #KT-41886 Fixed
This commit is contained in:
committed by
teamcity
parent
7d3368da58
commit
76aaecbdf0
@@ -462,11 +462,14 @@ class OptInUsageChecker(project: Project) : CallChecker {
|
||||
}
|
||||
|
||||
if (element.getParentOfType<KtImportDirective>(false) == null) {
|
||||
val containingClass = element.getParentOfType<KtClassOrObject>(strict = true)
|
||||
val descriptions = targetDescriptor.loadOptIns(
|
||||
moduleAnnotationsResolver,
|
||||
bindingContext,
|
||||
context.languageVersionSettings,
|
||||
fromSupertype = element.getParentOfType<KtSuperTypeListEntry>(strict = true) != null
|
||||
fromSupertype = containingClass != null && containingClass.superTypeListEntries.any {
|
||||
it.typeAsUserType == element.parent
|
||||
}
|
||||
)
|
||||
reportNotAllowedOptIns(descriptions, element, context)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user