IR: improve toString for symbols

This commit is contained in:
Alexander Udalov
2022-01-24 13:47:08 +01:00
parent cd118e4723
commit 6e4131de8e
3 changed files with 4 additions and 6 deletions
@@ -29,7 +29,8 @@ abstract class IrSymbolBase<out D : DeclarationDescriptor>(
override fun toString(): String {
if (isBound) return owner.render()
return "Unbound private symbol ${super.toString()}"
return "Unbound private symbol " +
if (_descriptor != null) "${this::class.java.simpleName}: $_descriptor" else super.toString()
}
}
@@ -28,7 +28,7 @@ abstract class IrPublicSymbolBase<out D : DeclarationDescriptor> @OptIn(Obsolete
override fun toString(): String {
if (isBound) return owner.render()
return "Unbound public symbol for $signature"
return "Unbound public symbol ${this::class.java.simpleName}: $signature"
}
}
@@ -1128,9 +1128,6 @@ val SymbolTable.allUnbound: Set<IrSymbol>
fun SymbolTable.noUnboundLeft(message: String) {
val unbound = this.allUnbound
assert(unbound.isEmpty()) {
"$message\n" +
unbound.joinToString("\n") {
"${it::class.simpleName} $it ${it.signature?.toString() ?: "(NON-PUBLIC API)"}: ${it.descriptor}"
}
message + "\n" + unbound.joinToString("\n")
}
}