[NI] Consider synthetic lower nullability constraint non-proper

This commit is contained in:
Pavel Kirpichenkov
2020-01-15 14:14:54 +03:00
parent 07041574da
commit 2896642f94
7 changed files with 43 additions and 1 deletions
@@ -131,7 +131,9 @@ class VariableFixationFinder(
notFixedTypeVariables[variable]?.constraints?.any { isProperArgumentConstraint(it) } ?: false
private fun Context.isProperArgumentConstraint(c: Constraint) =
isProperType(c.type) && c.position.initialConstraint.position !is DeclaredUpperBoundConstraintPosition
isProperType(c.type)
&& c.position.initialConstraint.position !is DeclaredUpperBoundConstraintPosition
&& !c.isNullabilityConstraint
private fun Context.isProperType(type: KotlinTypeMarker): Boolean =
!type.contains { notFixedTypeVariables.containsKey(it.typeConstructor()) }