[NI] Fix composite substitution for stubbed type in builder-inference

#KT-32038 Fixed
This commit is contained in:
Mikhail Zarechenskiy
2019-06-18 15:03:31 +03:00
parent 7df13c986e
commit 5cf7c7e5bf
5 changed files with 67 additions and 1 deletions
@@ -217,6 +217,8 @@ class CoroutineInferenceSession(
class ComposedSubstitutor(val left: NewTypeSubstitutor, val right: NewTypeSubstitutor) : NewTypeSubstitutor {
override fun substituteNotNullTypeWithConstructor(constructor: TypeConstructor): UnwrappedType? {
return left.safeSubstitute(right.substituteNotNullTypeWithConstructor(constructor) ?: return null)
return left.substituteNotNullTypeWithConstructor(
right.substituteNotNullTypeWithConstructor(constructor)?.constructor ?: constructor
)
}
}