Skip to content

Incorrect representation of unsigned number types #127

@manusaurio

Description

@manusaurio

The REPL has a weird issue to show unsigned values, although this only happens when they are "by themselves:"

[0] listOf(ULong.MAX_VALUE) // okay
res0: List<ULong> = [18446744073709551615]
[1] ULong.MAX_VALUE // nope
res1: ULong = -1
[2] 0UL - 1UL // nope
res2: ULong = -1
[3] (0UL - 1UL).toString() // okay
res3: String = 18446744073709551615
[4]

I don't know how Kotlin internals work with numbers nor how they're used in Ki, but it seems when the representation for unsigned types is triggered their .toString() isn't getting called. Could it be related to the fact that these types were built around JVM native types with some hacks? (a long doesn't have methods after all.)

I'm working with the 0.5.1 version of Ki and Kotlin 1.7.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions