JS: support unsigned constants inside string templates
This commit is contained in:
committed by
Ilya Gorbunov
parent
6103df0b31
commit
2663d9751a
+6
-1
@@ -1,13 +1,18 @@
|
||||
// WITH_UNSIGNED
|
||||
// IGNORE_BACKEND: JVM_IR, JS_IR, JS
|
||||
// IGNORE_BACKEND: JVM_IR, JS_IR
|
||||
|
||||
const val MAX_BYTE: UByte = 0xFFu
|
||||
const val HUNDRED: UByte = 100u
|
||||
|
||||
const val MAX_LONG: ULong = ULong.MAX_VALUE
|
||||
|
||||
fun box(): String {
|
||||
val maxByteStringSingle = "$MAX_BYTE"
|
||||
if (maxByteStringSingle != MAX_BYTE.toString() || maxByteStringSingle != "255") return "Fail 1: $maxByteStringSingle"
|
||||
|
||||
val maxLongStringSingle = "$MAX_LONG"
|
||||
if (maxLongStringSingle != MAX_LONG.toString() || maxLongStringSingle != "18446744073709551615") return "Fail 1.5: $maxLongStringSingle"
|
||||
|
||||
val twoHundredUByte = "${(HUNDRED * 2u).toUByte()}"
|
||||
if (twoHundredUByte != "200") return "Fail 2: $twoHundredUByte"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user