[kotlin] Clean up type provider deprecations in Analysis API usages

^KT-68884

GitOrigin-RevId: 12ca6e22249cffbc2afcb4cd62a197d323b1d121
This commit is contained in:
Yan Zhulanow
2024-07-11 18:49:25 +09:00
committed by intellij-monorepo-bot
parent 9c7e738f14
commit a4810f4939
30 changed files with 56 additions and 55 deletions

View File

@@ -198,13 +198,13 @@ internal class ForbiddenInSuspectContextMethodInspection : LocalInspectionTool()
return buildList<LocalQuickFix> {
add(ReplaceInvokeLaterWithWithContextQuickFix(callExpression))
val implicitReceiverTypesAtPosition = getImplicitReceiverTypesAtPosition(callExpression)
val implicitReceiverTypesAtPosition = collectImplicitReceiverTypes(callExpression)
val coroutineScopeClass = ClassId.topLevel(FqName(COROUTINE_SCOPE))
val hasCoroutineScope = implicitReceiverTypesAtPosition.any { type ->
type is KaUsualClassType &&
(
type.classId == coroutineScopeClass ||
type.getAllSuperTypes().any { superType -> superType is KaUsualClassType && superType.classId == coroutineScopeClass }
type.allSupertypes.any { superType -> superType is KaUsualClassType && superType.classId == coroutineScopeClass }
)
}
if (hasCoroutineScope) {