Don't render pure error types in OverrideMemberChooserObject
#KT-34379 Fixed
This commit is contained in:
@@ -251,6 +251,7 @@ interface DescriptorRendererOptions {
|
||||
var parameterNamesInFunctionalTypes: Boolean
|
||||
var renderFunctionContracts: Boolean
|
||||
var presentableUnresolvedTypes: Boolean
|
||||
var informativeErrorType: Boolean
|
||||
}
|
||||
|
||||
object ExcludedTypeAnnotations {
|
||||
|
||||
@@ -244,7 +244,11 @@ internal class DescriptorRendererImpl(
|
||||
if (type is UnresolvedType && presentableUnresolvedTypes) {
|
||||
append(type.presentableName)
|
||||
} else {
|
||||
append(type.constructor.toString()) // Debug name of an error type is more informative
|
||||
if (type is ErrorType && !informativeErrorType) {
|
||||
append(type.presentableName)
|
||||
} else {
|
||||
append(type.constructor.toString()) // Debug name of an error type is more informative
|
||||
}
|
||||
}
|
||||
append(renderTypeArguments(type.arguments))
|
||||
} else {
|
||||
|
||||
@@ -127,4 +127,6 @@ internal class DescriptorRendererOptionsImpl : DescriptorRendererOptions {
|
||||
override var presentableUnresolvedTypes: Boolean by property(false)
|
||||
|
||||
override var boldOnlyForNamesInHtml: Boolean by property(false)
|
||||
|
||||
override var informativeErrorType: Boolean by property(true)
|
||||
}
|
||||
|
||||
@@ -22,10 +22,11 @@ import org.jetbrains.kotlin.types.checker.KotlinTypeRefiner
|
||||
import org.jetbrains.kotlin.types.refinement.TypeRefinement
|
||||
|
||||
open class ErrorType @JvmOverloads internal constructor(
|
||||
override val constructor: TypeConstructor,
|
||||
override val memberScope: MemberScope,
|
||||
override val arguments: List<TypeProjection> = emptyList(),
|
||||
override val isMarkedNullable: Boolean = false
|
||||
override val constructor: TypeConstructor,
|
||||
override val memberScope: MemberScope,
|
||||
override val arguments: List<TypeProjection> = emptyList(),
|
||||
override val isMarkedNullable: Boolean = false,
|
||||
open val presentableName: String = "???"
|
||||
) : SimpleType() {
|
||||
override val annotations: Annotations
|
||||
get() = Annotations.EMPTY
|
||||
@@ -43,14 +44,14 @@ open class ErrorType @JvmOverloads internal constructor(
|
||||
}
|
||||
|
||||
class UnresolvedType(
|
||||
val presentableName: String,
|
||||
constructor: TypeConstructor,
|
||||
memberScope: MemberScope,
|
||||
arguments: List<TypeProjection>,
|
||||
isMarkedNullable: Boolean
|
||||
override val presentableName: String,
|
||||
constructor: TypeConstructor,
|
||||
memberScope: MemberScope,
|
||||
arguments: List<TypeProjection>,
|
||||
isMarkedNullable: Boolean
|
||||
) : ErrorType(constructor, memberScope, arguments, isMarkedNullable) {
|
||||
override fun makeNullableAsSpecified(newNullability: Boolean): SimpleType =
|
||||
UnresolvedType(presentableName, constructor, memberScope, arguments, newNullability)
|
||||
UnresolvedType(presentableName, constructor, memberScope, arguments, newNullability)
|
||||
|
||||
@TypeRefinement
|
||||
override fun refine(kotlinTypeRefiner: KotlinTypeRefiner) = this
|
||||
|
||||
Reference in New Issue
Block a user