Use parameter names in DescriptorRenderer
This commit is contained in:
@@ -309,7 +309,23 @@ internal class DescriptorRendererImpl(
|
||||
}
|
||||
|
||||
append("(")
|
||||
appendTypeProjections(getValueParameterTypesFromFunctionType(type))
|
||||
val parameterTypes = getValueParameterTypesFromFunctionType(type)
|
||||
val parameterNames = type.getParameterNamesFromFunctionType() ?: parameterTypes.map { SpecialNames.NO_NAME_PROVIDED }
|
||||
assert(parameterNames.size == parameterTypes.size)
|
||||
|
||||
for (index in parameterTypes.indices) {
|
||||
val typeProjection = parameterTypes[index]
|
||||
val name = parameterNames[index]
|
||||
|
||||
if (index > 0) append(", ")
|
||||
|
||||
if (!name.isSpecial) {
|
||||
append(renderName(name))
|
||||
append(": ")
|
||||
}
|
||||
append(renderTypeProjection(typeProjection))
|
||||
}
|
||||
|
||||
append(") ").append(arrow()).append(" ")
|
||||
renderNormalizedType(getReturnTypeFromFunctionType(type))
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ class FunctionType(
|
||||
override val isError: Boolean get() = false
|
||||
}
|
||||
|
||||
fun KotlinType.getFunctionTypeParameterNames(): List<Name>? = (unwrap() as? FunctionType)?.parameterNames
|
||||
fun KotlinType.getParameterNamesFromFunctionType(): List<Name>? = (unwrap() as? FunctionType)?.parameterNames
|
||||
|
||||
class LazyWrappedType(storageManager: StorageManager, computation: () -> KotlinType): WrappedType() {
|
||||
private val lazyValue = storageManager.createLazyValue(computation)
|
||||
|
||||
Reference in New Issue
Block a user