[FIR] remove user code leaks from compiler.fir.tree module, add more information to some errors
This commit is contained in:
committed by
Space Team
parent
a9cd881a07
commit
b5394d79b9
@@ -17,8 +17,10 @@ import org.jetbrains.kotlin.fir.expressions.arguments
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirBackingFieldSymbol
|
||||
import org.jetbrains.kotlin.fir.types.ConeClassLikeType
|
||||
import org.jetbrains.kotlin.fir.types.coneType
|
||||
import org.jetbrains.kotlin.fir.utils.exceptions.withFirSymbolIdEntry
|
||||
import org.jetbrains.kotlin.mpp.DeclarationSymbolMarker
|
||||
import org.jetbrains.kotlin.name.ClassId
|
||||
import org.jetbrains.kotlin.utils.exceptions.errorWithAttachment
|
||||
|
||||
abstract class FirBasedSymbol<E : FirDeclaration> : DeclarationSymbolMarker {
|
||||
private var _fir: E? = null
|
||||
@@ -26,7 +28,9 @@ abstract class FirBasedSymbol<E : FirDeclaration> : DeclarationSymbolMarker {
|
||||
@SymbolInternals
|
||||
val fir: E
|
||||
get() = _fir
|
||||
?: error("Fir is not initialized for $this")
|
||||
?: errorWithAttachment("Fir is not initialized for ${this::class}") {
|
||||
withFirSymbolIdEntry("symbol", this@FirBasedSymbol)
|
||||
}
|
||||
|
||||
fun bind(e: E) {
|
||||
_fir = e
|
||||
|
||||
Reference in New Issue
Block a user