FIR: Replace fir.bounds with resolvedBounds where it is appropriate

If there is a `coneType` call immediately after the `fir.bounds` call,
it means that the fully resolved type is expected, hence
`resolvedBounds` should be used
This commit is contained in:
Roman Golyshev
2022-01-12 15:12:19 +03:00
committed by teamcity
parent 939e4d1e77
commit 4418d76a0d
17 changed files with 25 additions and 25 deletions
@@ -153,7 +153,7 @@ fun FirTypeProjection.toConeTypeProjection(): ConeTypeProjection =
}
private fun ConeTypeParameterType.hasNotNullUpperBound(): Boolean {
return lookupTag.typeParameterSymbol.fir.bounds.any {
return lookupTag.typeParameterSymbol.resolvedBounds.any {
val boundType = it.coneType
if (boundType is ConeTypeParameterType) {
boundType.hasNotNullUpperBound()
@@ -175,7 +175,7 @@ val ConeKotlinType.canBeNull: Boolean
return when (this) {
is ConeFlexibleType -> upperBound.canBeNull
is ConeDefinitelyNotNullType -> false
is ConeTypeParameterType -> this.lookupTag.typeParameterSymbol.fir.bounds.all { it.coneType.canBeNull }
is ConeTypeParameterType -> this.lookupTag.typeParameterSymbol.resolvedBounds.all { it.coneType.canBeNull }
is ConeIntersectionType -> intersectedTypes.all { it.canBeNull }
else -> isNullable
}