FIR: enable useCorrectedNullabilityForFlexibleTypeParameters

It's necessary for correct substitution of `T & Any` with `T = V..V?`.
This commit is contained in:
pyos
2021-09-02 10:57:50 +02:00
committed by teamcityserver
parent bbc476f44e
commit a475453a01
4 changed files with 20 additions and 72 deletions
@@ -143,8 +143,7 @@ private fun ConeKotlinType.enhanceInflexibleType(
val mergedAttributes = if (shouldAddAttribute) attributes + CompilerConeAttributes.EnhancedNullability else attributes
val enhancedType = enhancedTag.constructType(mergedArguments, enhancedNullability, mergedAttributes)
return if (effectiveQualifiers.isNotNullTypeParameter)
ConeDefinitelyNotNullType.create(enhancedType, session.typeContext, useCorrectedNullabilityForFlexibleTypeParameters = true)
?: enhancedType
ConeDefinitelyNotNullType.create(enhancedType, session.typeContext) ?: enhancedType
else
enhancedType
}