You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 10, 2021. It is now read-only.
I've tried to build static/dynamic libs for iOS/Android, but "unknown type name 'libtestlib_kref_kotlin_IntArray" error occurs.
If I build an executable file for MacOS it compiles and works fine without any errors.
How can I treat it?
OS: MacOS, kotlin 1.3.61
Full code of my sample:
//******************************************
package test
Hello, @algidrus! Thank you for the report, seems like this is a bug.
The problem here is that, for some reason, UIntArray presence in your case did not lead to an appropriate typedef declaration in the produced library header. This can be reproduced with any primitive unsigned-type array. For signed-type ones, everything works correctly - even in your case, this is the reason why only IntArray failed - because of the first function, libtestlib_kref_kotlin_ByteArray typedef was generated correctly.
To workaround this issue, I would recommend exposing all primitive type arrays explicitly - for example, just add a top-level val regIntArray = intArrayof().
And this is working correctly for Mac because of executables have no headers. If you'll try to build a library, it will fail the same way, I checked 🙂.
I've tried to build static/dynamic libs for iOS/Android, but "unknown type name 'libtestlib_kref_kotlin_IntArray" error occurs.
If I build an executable file for MacOS it compiles and works fine without any errors.
How can I treat it?
OS: MacOS, kotlin 1.3.61
Full code of my sample:
//******************************************
package test
import kotlin.text.*
import kotlin.native.concurrent.*
fun findSum(br: ByteArray): Double {
var sum: Double = 0.0
for (i in 0..br.lastIndex) {
sum+=br[i].toDouble()
}
return sum
}
fun findSum(br: UByteArray): Double {
var sum: Double = 0.0
for (i in 0..br.lastIndex) {
sum+=br[i].toDouble()
}
return sum
}
fun findSum(br: UIntArray): Double {
var sum: Double = 0.0
for (i in 0..br.lastIndex) {
sum+=br[i].toDouble()
}
return sum
}
@kotlin.ExperimentalStdlibApi
fun main(args: Array)
{
var sum = 0.0
val arr_b = byteArrayOf(10.toByte(),
20.toByte(),
30.toByte(),
40.toByte(),
50.toByte(),
60.toByte(),
70.toByte(),
80.toByte(),
90.toByte())
}
The text was updated successfully, but these errors were encountered: