NI: propagate isNullabilityConstraint flag into constraint injector and inherit it

^KT-37510 Fixed
This commit is contained in:
Victor Petukhov
2020-04-07 13:50:50 +03:00
parent 19e352a1b5
commit 11d05c1abd
11 changed files with 142 additions and 26 deletions
@@ -259,7 +259,7 @@ class CoroutineInferenceSupport(
private val allowOnlyTrivialConstraints: Boolean
) : ClassicTypeCheckerContext(errorTypeEqualsToAnything = true) {
override fun addSubtypeConstraint(subType: KotlinTypeMarker, superType: KotlinTypeMarker): Boolean? {
override fun addSubtypeConstraint(subType: KotlinTypeMarker, superType: KotlinTypeMarker, isFromNullabilityConstraint: Boolean): Boolean? {
require(subType is UnwrappedType)
require(superType is UnwrappedType)
val typeTemplate = subType as? TypeTemplate ?: superType as? TypeTemplate