Added tests for KT-29833

This commit is contained in:
Dmitry Petrov
2019-02-15 14:29:27 +03:00
parent 4c3d0cd9d7
commit 08de82db85
8 changed files with 107 additions and 0 deletions
@@ -236,6 +236,15 @@ abstract class AbstractIrTextTestCase : AbstractIrGeneratorTestCase() {
private fun IrSymbol.checkBinding(kind: String, irElement: IrElement) {
if (!isBound) {
error("${javaClass.simpleName} $descriptor is unbound @$kind ${irElement.render()}")
} else {
val irDeclaration = owner as? IrDeclaration
if (irDeclaration != null) {
try {
irDeclaration.parent
} catch (e: Throwable) {
error("Referenced declaration has no parent: ${irDeclaration.render()}")
}
}
}
val otherSymbol = symbolForDeclaration.getOrPut(owner) { this }