Open manusaurio opened 1 year ago
Ok I was not too far off with my assumption (about the issue being related to the implementation of unsigned types.) I modified the output here to include value
's class. It should say ULong
, but it's Long
instead.
https://github.com/Kotlin/kotlin-interactive-shell/blob/03ddf993ade5154fc923bc29c84e1170d512b486/ki-shell/src/main/kotlin/org/jetbrains/kotlinx/ki/shell/Shell.kt#L305C1-L306
is ResultValue.Value ->
println("${evalResultValue.name}${renderResultType(evalResultValue)} = ${evalResultValue.value} | ${evalResultValue.value!!::class}".bound(settings.maxResultLength))
[0] 0UL
res0: ULong = 0 | kotlin.Long
The REPL has a weird issue to show unsigned values, although this only happens when they are "by themselves:"
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? (along
doesn't have methods after all.)I'm working with the 0.5.1 version of Ki and Kotlin 1.7.0.