[FIR] Add opt-in annotation which prevents from using symbol.fir

This commit is contained in:
Dmitriy Novozhilov
2021-07-07 17:51:01 +03:00
committed by teamcityserver
parent c99a02796f
commit e94d75d433
5 changed files with 45 additions and 1 deletions
@@ -13,6 +13,7 @@ import org.jetbrains.kotlin.fir.declarations.FirDeclarationOrigin
abstract class FirBasedSymbol<E : FirDeclaration> {
private var _fir: E? = null
@SymbolInternals
val fir: E
get() = _fir
?: error("Fir is not initialized for $this")
@@ -30,3 +31,6 @@ abstract class FirBasedSymbol<E : FirDeclaration> {
val moduleData: FirModuleData
get() = fir.moduleData
}
@RequiresOptIn
annotation class SymbolInternals