[JS IR BE] Fix fqNames in moveBodilessDeclarationsToSeparatePlace

This commit is contained in:
Svyatoslav Kuzmich
2019-02-27 16:17:41 +03:00
parent d333a0ad4e
commit 4005b5ce10
2 changed files with 61 additions and 46 deletions
@@ -575,4 +575,13 @@ val IrDeclaration.file: IrFile get() = parent.let {
is IrDeclaration -> it.file
else -> TODO("Unexpected declaration parent")
}
}
}
fun IrDeclarationWithName.getFqName(): FqName? {
val parentFqName = when (val parent = parent) {
is IrPackageFragment -> parent.fqName
is IrDeclarationWithName -> parent.getFqName()
else -> null
}
return parentFqName?.child(name)
}