[FIR] Use flexible type lower bound when approximating type for
IntegerLiteral.
This commit is contained in:
committed by
Mikhail Glukhikh
parent
d5141674a3
commit
425ce8c3ab
@@ -61,9 +61,9 @@ class ConeIntegerLiteralTypeImpl : ConeIntegerLiteralType {
|
||||
}
|
||||
|
||||
override fun getApproximatedType(expectedType: ConeKotlinType?): ConeClassLikeType {
|
||||
val approximatedType = when (expectedType) {
|
||||
val approximatedType = when (val expectedTypeForApproximation = expectedType?.lowerBoundIfFlexible()) {
|
||||
null, !in possibleTypes -> possibleTypes.first()
|
||||
else -> expectedType as ConeClassLikeType
|
||||
else -> expectedTypeForApproximation as ConeClassLikeType
|
||||
}
|
||||
return approximatedType.withNullability(nullability)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user