FIR initializer: don't report type mismatch in SomeInt = Int case

This commit is contained in:
Mikhail Glukhikh
2021-04-09 15:42:28 +03:00
parent 57d2eb5da2
commit fa4d664a18
7 changed files with 44 additions and 32 deletions
@@ -76,6 +76,9 @@ val ConeKotlinType.isNonPrimitiveArray: Boolean
private val builtinUnsignedTypes = setOf(StandardClassIds.UInt, StandardClassIds.UByte, StandardClassIds.ULong, StandardClassIds.UShort)
val ConeKotlinType.isUnsignedTypeOrNullableUnsignedType: Boolean get() = isAnyOfBuiltinType(builtinUnsignedTypes)
private val builtinIntegerTypes = setOf(StandardClassIds.Int, StandardClassIds.Byte, StandardClassIds.Long, StandardClassIds.Short)
val ConeKotlinType.isIntegerTypeOrNullableIntegerTypeOfAnySize: Boolean get() = isAnyOfBuiltinType(builtinIntegerTypes)
private fun ConeKotlinType.isBuiltinType(classId: ClassId, isNullable: Boolean): Boolean {
if (this !is ConeClassLikeType) return false
return lookupTag.classId == classId && type.isNullable == isNullable