Fix rendering of local anonymous object types for quick doc
#KT-8893 fixed
This commit is contained in:
@@ -60,6 +60,25 @@ import org.jetbrains.kotlin.utils.addToStdlib.constant
|
||||
|
||||
class HtmlClassifierNamePolicy(val base: ClassifierNamePolicy) : ClassifierNamePolicy {
|
||||
override fun renderClassifier(classifier: ClassifierDescriptor, renderer: DescriptorRenderer): String {
|
||||
if (DescriptorUtils.isAnonymousObject(classifier)) {
|
||||
|
||||
val supertypes = classifier.typeConstructor.supertypes
|
||||
return buildString {
|
||||
append("<anonymous object")
|
||||
if (supertypes.isNotEmpty()) {
|
||||
append(" : ")
|
||||
supertypes.joinTo(this) {
|
||||
val ref = it.constructor.declarationDescriptor
|
||||
if (ref != null)
|
||||
renderClassifier(ref, renderer)
|
||||
else
|
||||
"<ERROR CLASS>"
|
||||
}
|
||||
}
|
||||
append(">")
|
||||
}
|
||||
}
|
||||
|
||||
val name = base.renderClassifier(classifier, renderer)
|
||||
if (classifier.isBoringBuiltinClass())
|
||||
return name
|
||||
|
||||
Reference in New Issue
Block a user