Why `vararg` argument not available for ObjC inter...
# kotlin-native
g
Why
vararg
argument not available for ObjC interop in methods like NSString.stringWithFormat? Is this something that not supported yet, or has some unsolvable interop problems? https://developer.apple.com/documentation/foundation/nsstring/1497275-stringwithformat
Okay, found the answer here: https://github.com/JetBrains/kotlin-native/issues/1834
However initWithFormat appears to be variadic, and Kotlin/Native doesn’t support variadic Objective-C methods.
Really curious about problems with variadic functions support
s
C variadic functions differ a lot from Kotlin variadic functions. For example, in C variadic function you generally can’t find types and count of variadic arguments dynamically. That’s why it is impossible to override variadic Objective-C method with Kotlin function. So to support variadic Objective-C methods we have to do one of the following: • Make them non-overridable (and provide the separate implementation for this case) • Don’t represent C vararg as Kotlin array-like vararg.