https://kotlinlang.org logo
#kotlin-native
Title
# kotlin-native
m

mbonnin

10/04/2023, 6:06 PM
If I have a
platform.darwin.NSUInteger
that's marked
@UnsafeNumber
, can I know what to put in
actualPlatformTypes
if I want to propagate the
@UnsafeNumber
?
Copy code
@UnsafeNumber(["what here?"])
  fun stuff(foo: NSUInteger) {
    // stuff
  }
r

Rick Clephas

10/04/2023, 6:25 PM
The format is documented. So if you know the platform types you could create the strings.
m

mbonnin

10/04/2023, 6:27 PM
Thing is I'm lazy. Surely someone made it for
NSUInteger
and friends already?
Ideally I was expecting to be able to Ctrl click the
NSUInteger
symbol and copy/paste what's there but it's somehow not there
r

Rick Clephas

10/04/2023, 6:31 PM
Ideally I was expecting to be able to Ctrl click the NSUInteger symbol and copy/paste what’s there but it’s somehow not there
Ah that was indeed what I was expecting as well 😅
😁 1
A quick test and the Apple docs tell me that only
watchosArm32
and
watchosArm64
use
UInt
the other non-deprecated Apple targets are using
ULong
. So in that case the following should be it:
Copy code
@UnsafeNumber(["ios_arm64:kotlin.ULong", "ios_x64:kotlin.ULong", "ios_simulator_arm64:kotlin.ULong", "watchos_arm32:kotlin.UInt", "watchos_arm64:kotlin.UInt", "watchos_x64:kotlin.ULong", "watchos_simulator_arm64:kotlin.ULong", "watchos_device_arm64:kotlin.ULong", "tvos_arm64:kotlin.ULong", "tvos_x64:kotlin.ULong", "tvos_simulator_arm64:kotlin.ULong", "macos_x64:kotlin.ULong", "macos_arm64:kotlin.ULong"])
🤩 1
❤️ 1
thank you color 1
m

mbonnin

10/04/2023, 6:47 PM
Thanks!
👍🏻 1
r

Rick Clephas

10/04/2023, 6:52 PM
Hmm not sure but might even be a bug in the Kotlin IntelliJ plugin. The propagate option just adds
@UnsafeNumber
without the values 🤔
nod 1
m

mbonnin

10/04/2023, 7:01 PM
Nice!