Minor: explicitly throw exception if declaration parent is not set
This commit is contained in:
+7
-1
@@ -31,7 +31,13 @@ abstract class IrDeclarationBase(
|
||||
) : IrElementBase(startOffset, endOffset),
|
||||
IrDeclaration {
|
||||
|
||||
override lateinit var parent: IrDeclarationParent
|
||||
private var _parent: IrDeclarationParent? = null
|
||||
override var parent: IrDeclarationParent
|
||||
get() = _parent
|
||||
?: throw IllegalStateException("Parent not initialized: $this")
|
||||
set(v) {
|
||||
_parent = v
|
||||
}
|
||||
|
||||
override val annotations: MutableList<IrConstructorCall> = ArrayList()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user