[IR/FIR] Use isExpect from IR element instead of descriptor in

ExpectDeclarationRemover.
This commit is contained in:
Mark Punzalan
2020-05-12 22:55:01 -07:00
committed by Alexander Udalov
parent 23c4eac45b
commit 371c4561a0
11 changed files with 6 additions and 12 deletions
@@ -53,8 +53,12 @@ class ExpectDeclarationRemover(val symbolTable: ReferenceSymbolTable, private va
}
private fun shouldRemoveTopLevelDeclaration(declaration: IrDeclaration): Boolean {
val descriptor = declaration.descriptor
return doRemove && descriptor is MemberDescriptor && descriptor.isExpect
return doRemove && when (declaration) {
is IrClass -> declaration.isExpect
is IrProperty -> declaration.isExpect
is IrFunction -> declaration.isExpect
else -> false
}
}
private fun tryCopyDefaultArguments(declaration: IrValueParameter) {