Changes on code review

This commit is contained in:
Valentin Kipyatkov
2016-09-14 15:53:44 +03:00
parent c0ea237ba4
commit 6527ada775
6 changed files with 13 additions and 39 deletions
@@ -311,7 +311,7 @@ internal class DescriptorRendererImpl(
append("(")
val parameterTypes = getValueParameterTypesFromFunctionType(type)
val parameterNames = type.getParameterNamesFromFunctionType() ?: parameterTypes.map { SpecialNames.NO_NAME_PROVIDED }
assert(parameterNames.size == parameterTypes.size)
assert(parameterNames.size == parameterTypes.size) { "Number of names does not match number of types for $type"}
for (index in parameterTypes.indices) {
val typeProjection = parameterTypes[index]
@@ -51,22 +51,6 @@ object KotlinTypeFactory {
arguments: List<TypeProjection>
): SimpleType = SimpleTypeImpl(annotations, descriptor.typeConstructor, arguments, false, descriptor.getMemberScope(arguments))
@JvmStatic
fun functionType(
annotations: Annotations,
descriptor: ClassDescriptor,
arguments: List<TypeProjection>,
parameterNames: List<Name>?
): SimpleType {
val simpleType = simpleNotNullType(annotations, descriptor, arguments)
if (parameterNames == null || parameterNames.all { it.isSpecial }) {
return simpleType
}
else {
return FunctionType(simpleType, parameterNames)
}
}
@JvmStatic
fun simpleType(
baseType: SimpleType,