If I have a `platform.darwin.NSUInteger` that's marked `@UnsafeNumber` , can I know what to put in `...
m
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
The format is documented. So if you know the platform types you could create the strings.
m
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
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
Thanks!
๐Ÿ‘๐Ÿป 1
r
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
Nice!