Minor. remove several methods from TypeUtils

This commit is contained in:
Stanislav Erokhin
2016-06-02 07:30:14 +03:00
parent f41c8dc045
commit a6da15f8e2
11 changed files with 22 additions and 37 deletions
@@ -48,16 +48,16 @@ private fun KotlinType.approximateNonDynamicFlexibleTypes(preferNotNull: Boolean
// Foo<Bar!>! -> Foo<Bar>?
var approximation =
if (isCollection)
TypeUtils.makeNullableAsSpecified(if (isAnnotatedReadOnly()) flexible.upperBound else flexible.lowerBound, !preferNotNull)
(if (isAnnotatedReadOnly()) flexible.upperBound else flexible.lowerBound).makeNullableAsSpecified(!preferNotNull)
else
if (preferNotNull) flexible.lowerBound else flexible.upperBound
approximation = approximation.approximateNonDynamicFlexibleTypes()
approximation = if (isAnnotatedNotNull()) TypeUtils.makeNotNullable(approximation) else approximation
approximation = if (isAnnotatedNotNull()) approximation.makeNullableAsSpecified(false) else approximation
if (approximation.isMarkedNullable && !flexible.lowerBound.isMarkedNullable && TypeUtils.isTypeParameter(approximation) && TypeUtils.hasNullableSuperType(approximation)) {
approximation = TypeUtils.makeNotNullable(approximation)
approximation = approximation.makeNullableAsSpecified(false)
}
return approximation