ConeIntegerLiteralType: extract COMPARABLE_TAG

This commit is contained in:
Mikhail Glukhikh
2019-12-17 16:58:34 +03:00
parent 3d961ffe8f
commit 3544bf17f4
@@ -41,7 +41,7 @@ class ConeIntegerLiteralTypeImpl : ConeIntegerLiteralType {
override val supertypes: List<ConeClassLikeType> by lazy { override val supertypes: List<ConeClassLikeType> by lazy {
listOf( listOf(
NUMBER_TYPE, NUMBER_TYPE,
ConeClassLikeTypeImpl(ConeClassLikeLookupTagImpl(StandardClassIds.Comparable), arrayOf(ConeKotlinTypeProjectionOut(this)), false) ConeClassLikeTypeImpl(COMPARABLE_TAG, arrayOf(ConeKotlinTypeProjectionOut(this)), false)
) )
} }
@@ -63,6 +63,8 @@ class ConeIntegerLiteralTypeImpl : ConeIntegerLiteralType {
private val BYTE_RANGE = Byte.MIN_VALUE.toLong()..Byte.MAX_VALUE.toLong() private val BYTE_RANGE = Byte.MIN_VALUE.toLong()..Byte.MAX_VALUE.toLong()
private val SHORT_RANGE = Short.MIN_VALUE.toLong()..Short.MAX_VALUE.toLong() private val SHORT_RANGE = Short.MIN_VALUE.toLong()..Short.MAX_VALUE.toLong()
private val COMPARABLE_TAG = ConeClassLikeLookupTagImpl(StandardClassIds.Comparable)
fun findCommonSuperType(types: Collection<SimpleTypeMarker>): SimpleTypeMarker? { fun findCommonSuperType(types: Collection<SimpleTypeMarker>): SimpleTypeMarker? {
return findCommonSuperTypeOrIntersectionType(types, Mode.COMMON_SUPER_TYPE) return findCommonSuperTypeOrIntersectionType(types, Mode.COMMON_SUPER_TYPE)
} }