[NI] Fix nullability for captured type in input types approximation

This commit is contained in:
Dmitry Petrov
2017-06-09 12:32:18 +03:00
committed by Mikhail Zarechenskiy
parent e5c87fdad7
commit d4e8a30dcf
@@ -40,7 +40,9 @@ fun prepareArgumentTypeRegardingCaptureTypes(argumentType: UnwrappedType): Unwra
}
if (simpleType is NewCapturedType) {
// todo may be we should respect flexible capture types also...
return simpleType.constructor.supertypes.takeIf { it.isNotEmpty() }?.let{ intersectTypes(it) } ?: argumentType.builtIns.nullableAnyType
return simpleType.constructor.supertypes.takeIf { it.isNotEmpty() }?.let {
intersectTypes(it).makeNullableAsSpecified(simpleType.isMarkedNullable)
} ?: argumentType.builtIns.nullableAnyType
}
return captureFromExpression(simpleType)
}