FIR: replace constraint with NotFixedTypeToVariableSubstitutor properly

In this commit we add nullability to upper type of a substituted
constraint in the situation like (Stub<_L> <: SomeType),
where _L is fixed to nullable Stub<_L>?.
We have to change this constraint to L <: SomeType? and not to
L <: SomeType as before, otherwise nullability become broken
(direct substitution of Stub<_L> to L is illegal here).

#KT-50470 Fixed
This commit is contained in:
Mikhail Glukhikh
2021-12-22 09:59:50 +03:00
committed by teamcity
parent dafc6d849c
commit 6342eb96c0
5 changed files with 43 additions and 10 deletions
@@ -61,8 +61,8 @@ FILE: expectedType.kt
public final val property: R|FirProperty| = R|<local>/property|
public get(): R|FirProperty|
public final val expectedType: R|ConeKotlinType?|by <Inapplicable(INAPPLICABLE): /myLazy>#<R|ConeKotlinType|>(<L> = myLazy@fun <anonymous>(): R|ConeKotlinType| <inline=NoInline> {
^ this@R|/Session|.R|/Session.property|.R|/FirProperty.returnTypeRef|.<Inapplicable(INAPPLICABLE): /coneTypeSafe>#<R|ConeKotlinType|>()
public final val expectedType: R|ConeKotlinType?|by R|/myLazy|<R|ConeKotlinType?|>(<L> = myLazy@fun <anonymous>(): R|ConeKotlinType?| <inline=NoInline> {
^ this@R|/Session|.R|/Session.property|.R|/FirProperty.returnTypeRef|.R|/coneTypeSafe|<R|ConeKotlinType|>()
}
)
public get(): R|ConeKotlinType?| {