[FIR] Replace Deprecated with PrivateForInline in ScopeSession
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
/*
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.fir
|
||||
|
||||
@RequiresOptIn(level = RequiresOptIn.Level.ERROR)
|
||||
annotation class PrivateForInline
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user