Hi everyone. I'm investigating using the new (exp...
# swift-export
m
Hi everyone. I'm investigating using the new (experimental) swift export feature. One thing i've noticed right off the bat is that it's not handling default parameters in constructors.
Copy code
data class SomeClass(val value: Int = 0)
I can't instantiate this in swift code without supplying the
value
parameter. I'm unable to use SKIE because we're modeling log data which has a large number of optional constructor parameters, which SKIE isn't good at handling (as it tries to create all the different permutations available) Is there something i'm missing, or is this just not something available yet?
image.png
g
Unfortunately, we do not support default arguments yet
m
@Gleb Lukianets Fair enough, this is an experimental feature, so i'm just playing with it right now seeing if it can help us. Right now we take another input format (yaml) and do code generation on it. But I'd rather us just write it by hand kmp style. Are default parameter values on the list of features to be supported? If so, is it on the board for a stable release, or undetermined at this point?
g
They indeed are planned! It’s just that swift’s default argument model differs from kotlin’s too much for this feature to be included at these earliest stages, but it’s still a high priority to us.
❤️ 6
m
Thanks.