[K/JS] Add ability to use is checks on external objects

This commit is contained in:
Artem Kobzar
2023-03-10 11:33:30 +00:00
committed by Space Team
parent e5523c196e
commit ab7b429298
9 changed files with 64 additions and 0 deletions
@@ -57,6 +57,8 @@ fun IrType.isTypeParameter() = classifierOrNull is IrTypeParameterSymbol
fun IrType.isInterface() = classOrNull?.owner?.kind == ClassKind.INTERFACE
fun IrType.isExternalObject() = classOrNull?.owner.let { it?.kind == ClassKind.OBJECT && it.isExternal }
fun IrType.isAnnotation() = classOrNull?.owner?.kind == ClassKind.ANNOTATION_CLASS
fun IrType.isFunctionOrKFunction() = isFunction() || isKFunction()