psi2ir: support unsigned integer literals
NB in FE unsigned integer constants are now represented using signed integer types (e.g., UInt constant actually holds an Int value). So, in IR so far we also represent unsigned constant literals as constant values of corresponding signed types, but with corresponding unsigned type: 0xFFFF_FFFFu becomes 'CONST Int type=kotlin.UInt value=-1'
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
// !LANGUAGE: +InlineClasses
|
||||
// !SKIP_METADATA_VERSION_CHECK
|
||||
// WITH_UNSIGNED
|
||||
|
||||
val testSimpleUIntLiteral = 1u
|
||||
|
||||
val testSimpleUIntLiteralWithOverflow = 0xFFFF_FFFFu
|
||||
|
||||
val testUByteWithExpectedType: UByte = 1u
|
||||
|
||||
val testUShortWithExpectedType: UShort = 1u
|
||||
|
||||
val testUIntWithExpectedType: UInt = 1u
|
||||
|
||||
val testULongWithExpectedType: ULong = 1u
|
||||
|
||||
val testToUByte = 1.toUByte()
|
||||
|
||||
val testToUShort = 1.toUShort()
|
||||
|
||||
val testToUInt = 1.toUInt()
|
||||
|
||||
val testToULong = 1.toULong()
|
||||
Reference in New Issue
Block a user