IR: add toString for IrBased descriptors
To help in diagnosing issues like KT-44160.
This commit is contained in:
@@ -89,16 +89,15 @@ abstract class IrBasedDeclarationDescriptor<T : IrDeclaration>(val owner: T) : D
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getContainingDeclaration() = getContainingDeclaration(owner)
|
override fun getContainingDeclaration(): DeclarationDescriptor =
|
||||||
|
getContainingDeclaration(owner)
|
||||||
|
|
||||||
override fun equals(other: Any?): Boolean {
|
override fun equals(other: Any?): Boolean =
|
||||||
if (other !is IrBasedDeclarationDescriptor<*>) return false
|
other is IrBasedDeclarationDescriptor<*> && owner == other.owner
|
||||||
return owner == other.owner
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun hashCode(): Int {
|
override fun hashCode(): Int = owner.hashCode()
|
||||||
return owner.hashCode()
|
|
||||||
}
|
override fun toString(): String = javaClass.simpleName + ": " + owner.render()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun IrDeclaration.toIrBasedDescriptor(): DeclarationDescriptor = when (this) {
|
fun IrDeclaration.toIrBasedDescriptor(): DeclarationDescriptor = when (this) {
|
||||||
|
|||||||
Reference in New Issue
Block a user