IR: make IrSymbol.isPublicApi an extension
This commit is contained in:
@@ -33,11 +33,11 @@ interface IrSymbol {
|
||||
val isBound: Boolean
|
||||
|
||||
val signature: IdSignature?
|
||||
|
||||
val isPublicApi: Boolean
|
||||
get() = signature != null
|
||||
}
|
||||
|
||||
val IrSymbol.isPublicApi: Boolean
|
||||
get() = signature != null
|
||||
|
||||
interface IrBindableSymbol<out D : DeclarationDescriptor, B : IrSymbolOwner> : IrSymbol {
|
||||
override val owner: B
|
||||
|
||||
|
||||
-3
@@ -19,9 +19,6 @@ class DescriptorlessExternalPackageFragmentSymbol : IrExternalPackageFragmentSym
|
||||
private var _owner: IrExternalPackageFragment? = null
|
||||
override val owner get() = _owner!!
|
||||
|
||||
override val isPublicApi: Boolean
|
||||
get() = TODO("Not yet implemented")
|
||||
|
||||
override val signature: IdSignature?
|
||||
get() = TODO("Not yet implemented")
|
||||
|
||||
|
||||
@@ -98,8 +98,8 @@ fun IrType.isCollection(): Boolean = isNotNullClassType(IdSignatureValues.collec
|
||||
fun IrType.isNothing(): Boolean = isNotNullClassType(IdSignatureValues.nothing)
|
||||
|
||||
fun IrType.isPrimitiveType(hasQuestionMark: Boolean = false): Boolean =
|
||||
(this is IrSimpleType && hasQuestionMark == this.hasQuestionMark) &&
|
||||
classOrNull?.takeIf(IrClassSymbol::isPublicApi)?.signature in idSignatureToPrimitiveType
|
||||
(this is IrSimpleType && hasQuestionMark == this.hasQuestionMark) &&
|
||||
classOrNull?.signature in idSignatureToPrimitiveType
|
||||
|
||||
fun IrType.isNullablePrimitiveType(): Boolean = isPrimitiveType(true)
|
||||
|
||||
|
||||
@@ -1112,8 +1112,8 @@ fun SymbolTable.noUnboundLeft(message: String) {
|
||||
val unbound = this.allUnbound
|
||||
assert(unbound.isEmpty()) {
|
||||
"$message\n" +
|
||||
unbound.map {
|
||||
"$it ${if (it.isPublicApi) it.signature.toString() else "NON-PUBLIC API $it"}"
|
||||
}.joinToString("\n")
|
||||
unbound.joinToString("\n") {
|
||||
"$it ${it.signature?.toString() ?: "NON-PUBLIC API $it"}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user