[IR] Add wrapped descriptor for error declaration

This commit is contained in:
Roman Artemev
2020-09-28 19:31:04 +03:00
parent eacc94a89d
commit 8ce497c7ef
@@ -1049,6 +1049,24 @@ open class WrappedFieldDescriptor : PropertyDescriptor, WrappedDeclarationDescri
override fun <V : Any?> getUserData(key: CallableDescriptor.UserDataKey<V>?): V? = null
}
class WrappedErrorDescriptor : WrappedDeclarationDescriptor<IrErrorDeclaration>() {
override fun getName(): Name = error("WrappedErrorDescriptor.getName: Should not be reached")
override fun getOriginal(): DeclarationDescriptorWithSource =
error("WrappedErrorDescriptor.getOriginal: Should not be reached")
override fun getContainingDeclaration(): DeclarationDescriptor? =
error("WrappedErrorDescriptor.getContainingDeclaration: Should not be reached")
override fun <R : Any?, D : Any?> accept(visitor: DeclarationDescriptorVisitor<R, D>?, data: D): R {
error("WrappedErrorDescriptor.accept: Should not be reached")
}
override fun acceptVoid(visitor: DeclarationDescriptorVisitor<Void, Void>?) {
}
}
@OptIn(ObsoleteDescriptorBasedAPI::class)
private fun getContainingDeclaration(declaration: IrDeclarationWithName): DeclarationDescriptor {
val parent = declaration.parent