I'm dusting off some Kotlin/Native code I was toyi...
# kotlin-native
s
I'm dusting off some Kotlin/Native code I was toying with over the Summer. This code used to work but now I'm getting a compiler error.
Copy code
error: type mismatch: inferred type is ULong but int64_t /* = Long */ was expected
                val time = dispatch_time(DISPATCH_TIME_NOW, NSEC_PER_MSEC)
It doesn't like
NSEC_PER_MSEC
which is a constant defined in the darwin header. If I just put a literal number in its place it will work fine.
t
m
NSEC_PER_MSEC.toLong()
works?
On darwin it's
1000000ull
, on linux - just
1000000L
.
I think more relevant issue here is https://github.com/JetBrains/kotlin-native/issues/1971
o
you can use
convert()
in such cases