FIR: use withNullability with type context whenever possible

It could simplify flexible type cases.
This commit is contained in:
Jinseong Jeon
2021-05-01 22:58:03 -07:00
committed by TeamCityServer
parent f94ed1a00c
commit bb37728e4f
9 changed files with 37 additions and 23 deletions
@@ -412,7 +412,11 @@ class FirVisualizer(private val firFile: FirFile) : BaseRenderer() {
val lowerRendered = lowerBound.tryToRenderConeAsFunctionType()
if (lowerBound.nullability == ConeNullability.NOT_NULL && upperBound.nullability == ConeNullability.NULLABLE &&
AbstractStrictEqualityTypeChecker
.strictEqualTypes(session.typeContext, lowerBound, upperBound.withNullability(ConeNullability.NOT_NULL))
.strictEqualTypes(
session.typeContext,
lowerBound,
upperBound.withNullability(ConeNullability.NOT_NULL, session.typeContext)
)
) {
"$lowerRendered!"
} else {