Get rid of redundant not-null assertion for parameter

The problem was that in `Function<T>.apply(T)` T is now not-platform,
so when checking if not-null assertion is needed for parameter in SAM,
it's defined by the upper bounds of T that is a platform (Any..Any?),
and while it's definitely not marked as nullable it's still nullable
in a sense that it can contain null as a value.

So the solution is obvious

 #KT-16413 Fixed
This commit is contained in:
Denis Zharkov
2017-02-17 18:11:47 +03:00
parent 1bb7a617ad
commit f2aacf774e
3 changed files with 28 additions and 2 deletions
@@ -304,8 +304,7 @@ public class TypeUtils {
}
for (KotlinType supertype : getImmediateSupertypes(type)) {
if (supertype.isMarkedNullable()) return true;
if (hasNullableSuperType(supertype)) return true;
if (isNullableType(supertype)) return true;
}
return false;