p

    Paul Weber

    8 months ago
    Swift offers the possibility to omit argument names when calling a function if the function is declared like
    func foo(_ arg: Bar) {}
    . I.e., you can just
    foo(myArg)
    instead of having to
    foo(arg: myArg)
    It’s probably not possible to declare a function in kotlin that behaves the same way at the swift callsite, right?
    russhwolf

    russhwolf

    8 months ago
    The only scenario I'm aware of where you can do this is extension functions which (assuming they don't come through as Swift extensions) end up looking like
    func foo(_ receiver: Bar)
    e

    ephemient

    8 months ago
    Kotlin interoperates with Objective-C, so I suppose this could theoretically be possible by tweaking the Objective-C signature. I don't think it's possible in Kotlin/Native now, though.
    russhwolf

    russhwolf

    8 months ago
    Yeah they could definitely add an annotation or something to control this, but it doesn't exist now. Just like the lack of
    @JvmName
    and
    @JvmOverloads
    analogs in native