[FIR] Treat unsigned numbers as primitives in constant checker
This commit is contained in:
+1
-1
@@ -134,7 +134,7 @@ internal fun checkConstantArguments(
|
||||
|
||||
if (calleeReference.name == OperatorNameConventions.PLUS
|
||||
&& expClassId != receiverClassId
|
||||
&& (expClassId !in StandardClassIds.primitiveTypesAndString || receiverClassId !in StandardClassIds.primitiveTypesAndString)
|
||||
&& (expClassId !in StandardClassIds.constantAllowedTypes || receiverClassId !in StandardClassIds.constantAllowedTypes)
|
||||
) {
|
||||
return ConstantArgumentKind.NOT_CONST
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
const val a = "INT " + 0x8fffffffU
|
||||
const val b = "BYTE " + 0x8ffU
|
||||
|
||||
@@ -68,7 +68,6 @@ object StandardClassIds {
|
||||
Byte, Short, Int, Long,
|
||||
Float, Double
|
||||
)
|
||||
val primitiveTypesAndString = primitiveTypes + String
|
||||
|
||||
val primitiveArrayTypeByElementType = primitiveTypes.associate { id -> id to id.shortClassName.primitiveArrayId() }
|
||||
val elementTypeByPrimitiveArrayType = primitiveArrayTypeByElementType.inverseMap()
|
||||
@@ -77,6 +76,8 @@ object StandardClassIds {
|
||||
val unsignedArrayTypeByElementType = unsignedTypes.associate { id -> id to id.shortClassName.primitiveArrayId() }
|
||||
val elementTypeByUnsignedArrayType = unsignedArrayTypeByElementType.inverseMap()
|
||||
|
||||
val constantAllowedTypes = primitiveTypes + unsignedTypes + String
|
||||
|
||||
val Continuation =
|
||||
ClassId(StandardNames.COROUTINES_PACKAGE_FQ_NAME_RELEASE, StandardNames.CONTINUATION_INTERFACE_FQ_NAME_RELEASE.shortName())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user