[analysis] remove redundant OptIn annotations

This commit is contained in:
Dmitry Gridin
2022-08-12 21:28:32 +02:00
parent 8dbdea39da
commit c9e9ee90a3
20 changed files with 0 additions and 26 deletions
@@ -97,7 +97,6 @@ object KtDeclarationAndFirDeclarationEqualityChecker {
return true
}
@OptIn(ExperimentalStdlibApi::class)
private fun FirTypeRef.renderTypeAsKotlinType(isVararg: Boolean = false): String {
val rendered = when (this) {
is FirResolvedTypeRef -> type.renderTypeAsKotlinType()
@@ -147,7 +146,6 @@ object KtDeclarationAndFirDeclarationEqualityChecker {
return "kotlin.Array<out $this>"
}
@OptIn(ExperimentalStdlibApi::class)
private val classIdToName: Map<String, String> = buildList<Pair<String, String>> {
StandardClassIds.primitiveArrayTypeByElementType.mapTo(this) { (classId, arrayClassId) ->
classId.asString().replace('/', '.') to arrayClassId.asString().replace('/', '.')
@@ -57,7 +57,6 @@ internal class FileStructure private constructor(
?: error("FileStructureElement for was not defined for \n${declaration.getElementTextInContext()}")
}
@OptIn(ExperimentalStdlibApi::class)
fun getAllDiagnosticsForFile(diagnosticCheckerFilter: DiagnosticCheckerFilter): Collection<KtPsiDiagnostic> {
val structureElements = getAllStructureElements()
@@ -189,7 +189,6 @@ internal open class FirElementsRecorder : FirVisitor<Unit, MutableMap<KtElement,
}
companion object {
@OptIn(ExperimentalStdlibApi::class)
fun recordElementsFrom(firElement: FirElement, recorder: FirElementsRecorder): Map<KtElement, FirElement> =
buildMap { firElement.accept(recorder, this) }
}
@@ -24,7 +24,6 @@ class LLFirBuiltinSymbolProvider(
moduleData: FirModuleData,
kotlinScopeProvider: FirKotlinScopeProvider
) : FirBuiltinSymbolProvider(session, moduleData, kotlinScopeProvider) {
@OptIn(ExperimentalStdlibApi::class)
private val functionsCache = session.firCachesFactory.createCache { callableId: CallableId ->
buildList {
getTopLevelFunctionSymbolsToByPackageFragments(this, callableId.packageName, callableId.callableName)
@@ -10,7 +10,6 @@ import org.jetbrains.kotlin.analysis.project.structure.KtModule
import org.jetbrains.kotlin.fir.BuiltinTypes
import org.jetbrains.kotlin.fir.PrivateSessionConstructor
@OptIn(PrivateSessionConstructor::class)
class LLFirBuiltinsAndCloneableSession @PrivateSessionConstructor constructor(
override val ktModule: KtModule,
project: Project,
@@ -13,7 +13,6 @@ import org.jetbrains.kotlin.fir.PrivateSessionConstructor
/**
* [org.jetbrains.kotlin.fir.FirSession] responsible for all libraries analysing module transitively depends on
*/
@OptIn(PrivateSessionConstructor::class)
internal class LLFirLibrarySession @PrivateSessionConstructor constructor(
override val ktModule: KtModule,
project: Project,
@@ -114,7 +114,6 @@ private class LLFirSessionsCache {
return newMappings to result
}
@OptIn(ExperimentalStdlibApi::class)
private fun getSessions(): Map<KtModule, LLFirSession> = buildMap {
val sessions = mappings.values
val wasSessionInvalidated = sessions.associateWithTo(hashMapOf()) { false }
@@ -92,7 +92,6 @@ abstract class AbstractFileStructureTest : AbstractLowLevelApiSingleFileTest() {
return session.moduleComponents.fileStructureCache.getFileStructure(this)
}
@OptIn(ExperimentalStdlibApi::class)
private fun FileStructure.getAllStructureElements(ktFile: KtFile): Collection<FileStructureElement> = buildSet {
ktFile.forEachDescendantOfType<KtElement> { ktElement ->
add(getStructureElementFor(ktElement))