Skip to content

Commit

Permalink
[Commonizer] Generate correct TA types for callable descriptors
Browse files Browse the repository at this point in the history
Issue #KMM-217
  • Loading branch information
ddolovov committed Apr 17, 2020
1 parent 2938b69 commit a6064ec
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,24 @@ internal fun CirSimpleType.buildType(

// TODO: commonize annotations, KT-34234
val typeAnnotations = if (!targetComponents.isCommon) annotations.buildDescriptors(targetComponents) else Annotations.EMPTY
val rawType = simpleType(

val simpleType = simpleType(
annotations = typeAnnotations,
constructor = classifier.typeConstructor,
arguments = arguments.map { it.buildArgument(targetComponents, typeParameterResolver) },
nullable = isMarkedNullable,
kotlinTypeRefiner = null
)

return if (isDefinitelyNotNullType) rawType.makeSimpleTypeDefinitelyNotNullOrNotNull() else rawType
val computedType = if (classifier is TypeAliasDescriptor)
classifier.underlyingType.withAbbreviation(simpleType)
else
simpleType

return if (isDefinitelyNotNullType)
computedType.makeSimpleTypeDefinitelyNotNullOrNotNull()
else
computedType
}

internal fun findClassOrTypeAlias(
Expand Down

0 comments on commit a6064ec

Please sign in to comment.