Retain nullability information for type alias arguments which are in turn type aliases #KT-13835 Fixed

This commit is contained in:
Mikhail Glukhikh
2016-09-15 18:13:30 +03:00
parent 090d157f86
commit c1296e2134
6 changed files with 56 additions and 1 deletions
@@ -153,7 +153,11 @@ class TypeAliasExpander(
}
else -> {
val substitutedArguments = type.arguments.mapIndexed { i, originalArgument ->
expandTypeProjection(originalArgument, typeAliasExpansion, typeConstructor.parameters[i], recursionDepth + 1)
val projection = expandTypeProjection(
originalArgument, typeAliasExpansion, typeConstructor.parameters[i], recursionDepth + 1)
if (projection.isStarProjection) projection
else TypeProjectionImpl(projection.projectionKind,
TypeUtils.makeNullableIfNeeded(projection.type, originalArgument.type.isMarkedNullable))
}
val substitutedType = type.replace(newArguments = substitutedArguments)