For functions that return a slice of unsigned numeric primitives, the Kotlin code generator would get the return type correct, but be returning a slice of signed primitives instead.
For example:
// for a function fn get_slice<'a>() -> &'a [u8]
// the kotlin generated code would be
fun getSlice(): UByteArray {
val returnVal = ...
return PrimitiveArrayTools.getByteArray(returnVal) // should be getUByteArray
}
For functions that return a slice of unsigned numeric primitives, the Kotlin code generator would get the return type correct, but be returning a slice of signed primitives instead.
For example:
This PR fixes the bug.