PHondogo
07/30/2024, 7:31 PMfor (v in UByte.MIN_VALUE..UByte.MAX_VALUE) {
println(v) // it is going after 255 and more. Why?
}
ephemient
07/30/2024, 8:22 PMval range = UByte.MIN_VALUE..UByte.MAX_VALUE
for (v in range) println(v)
seems to work, so it seems like a compiler bug with intrinsificationephemient
07/30/2024, 8:27 PMfor (v in UByte.MIN_VALUE.toUInt()..UByte.MAX_VALUE.toUInt()) {
println(v)
}
also seems to work, despite being the same type of rangeephemient
07/30/2024, 8:41 PMfor (v in UByte.MAX_VALUE..UByte.MAX_VALUE) println(v)
println(UInt.MAX_VALUE)
prints the same thing so there is some inappropriate sign extension happeningephemient
07/30/2024, 8:41 PMPHondogo
07/30/2024, 8:50 PMPHondogo
07/30/2024, 8:52 PMephemient
07/30/2024, 8:55 PMfor (v in UByte.MAX_VALUE..UByte.MAX_VALUE) println(v)
prints the same wrong thing since Kotlin 1.7Klitos Kyriacou
07/31/2024, 9:02 AMephemient
07/31/2024, 9:05 AMoperator fun rangeTo(...): UIntRange