If I have an `expect fun test()` and 1 target, whi...
# multiplatform
e
If I have an
expect fun test()
and 1 target, which already has a
fun test() {}
(and doesn't have the
actual
keyword), is that supposed to work, or does
actual
need to be specified?
a
Technically it can work, although it is not recommended (at least at this moment). Consider moving
expect fun
to another package or different name, and then create its actual by re-using existing fun. If it is too boilerplate-ish and you are okay with lowering compiler safety, then you can declare just expect and suppress warning/error if there is any.
e
Ok I wasn't sure, because I wasn't getting any errors or warnings. However when I changed it to
expect fun test(foo: Bar)
and
fun test(foo: Bar)
I did get a warning