IR: relax type cast for WrappedVariableDescriptor.containingDeclaration

This commit is contained in:
Georgy Bronnikov
2020-10-18 14:15:35 +03:00
parent b588839752
commit 8e331c8afe
2 changed files with 2 additions and 2 deletions
@@ -308,7 +308,7 @@ fun IrTypeParameter.toIrBasedDescriptor() = IrBasedTypeParameterDescriptor(this)
open class IrBasedVariableDescriptor(owner: IrVariable) : VariableDescriptor, IrBasedCallableDescriptor<IrVariable>(owner) {
override fun getContainingDeclaration() = (owner.parent as IrFunction).toIrBasedDescriptor()
override fun getContainingDeclaration() = (owner.parent as IrDeclaration).toIrBasedDescriptor()
override fun getType() = owner.type.toIrBasedKotlinType()
override fun getReturnType() = getType()
override fun getName() = owner.name
@@ -303,7 +303,7 @@ open class WrappedTypeParameterDescriptor : TypeParameterDescriptor, WrappedDecl
@OptIn(ObsoleteDescriptorBasedAPI::class)
open class WrappedVariableDescriptor : VariableDescriptor, WrappedCallableDescriptor<IrVariable>() {
override fun getContainingDeclaration() = (owner.parent as IrFunction).descriptor
override fun getContainingDeclaration() = (owner.parent as IrDeclaration).descriptor
override fun getType() = owner.type.toKotlinType()
override fun getReturnType() = getType()
override fun getName() = owner.name