[FIR] Replace Deprecated with PrivateForInline in ScopeSession

This commit is contained in:
Dmitriy Novozhilov
2020-08-12 11:24:03 +03:00
parent b4dc7955b4
commit cb0b25ea39
2 changed files with 4 additions and 2 deletions
@@ -5,16 +5,18 @@
package org.jetbrains.kotlin.fir.resolve
import org.jetbrains.kotlin.fir.PrivateForInline
class ScopeSession {
private val scopes = hashMapOf<Any, HashMap<ScopeSessionKey<*, *>, Any>>()
var returnTypeCalculator: Any? = null
@Deprecated(level = DeprecationLevel.ERROR, message = "Only for getOrBuild")
@PrivateForInline
fun scopes() = scopes
@OptIn(PrivateForInline::class)
inline fun <reified ID : Any, reified FS : Any> getOrBuild(id: ID, key: ScopeSessionKey<ID, FS>, build: () -> FS): FS {
@Suppress("DEPRECATION_ERROR")
return scopes().getOrPut(id) {
hashMapOf()
}.getOrPut(key) {