From cb0b25ea39c4cf164719b50331bbd3280dcf6cf5 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Wed, 12 Aug 2020 11:24:03 +0300 Subject: [PATCH] [FIR] Replace `Deprecated` with `PrivateForInline` in ScopeSession --- .../src/org/jetbrains/kotlin/fir/PrivateForInline.kt | 0 .../src/org/jetbrains/kotlin/fir/resolve/ScopeSession.kt | 6 ++++-- 2 files changed, 4 insertions(+), 2 deletions(-) rename compiler/fir/{resolve => tree}/src/org/jetbrains/kotlin/fir/PrivateForInline.kt (100%) diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/PrivateForInline.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/PrivateForInline.kt similarity index 100% rename from compiler/fir/resolve/src/org/jetbrains/kotlin/fir/PrivateForInline.kt rename to compiler/fir/tree/src/org/jetbrains/kotlin/fir/PrivateForInline.kt diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/resolve/ScopeSession.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/resolve/ScopeSession.kt index 80ba7909d2d..e39f8b0b385 100644 --- a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/resolve/ScopeSession.kt +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/resolve/ScopeSession.kt @@ -5,16 +5,18 @@ package org.jetbrains.kotlin.fir.resolve +import org.jetbrains.kotlin.fir.PrivateForInline + class ScopeSession { private val scopes = hashMapOf, Any>>() var returnTypeCalculator: Any? = null - @Deprecated(level = DeprecationLevel.ERROR, message = "Only for getOrBuild") + @PrivateForInline fun scopes() = scopes + @OptIn(PrivateForInline::class) inline fun getOrBuild(id: ID, key: ScopeSessionKey, build: () -> FS): FS { - @Suppress("DEPRECATION_ERROR") return scopes().getOrPut(id) { hashMapOf() }.getOrPut(key) {