when having `expect interface` I understand the so...
# multiplatform
o
when having
expect interface
I understand the some platforms are expected to have an actual which is just an existing interface in another lib. But some platforms needs to provide the interface, which makes it just duplicating the same signature. For example in kotlin-logging I had an expected interface KLogger which in jvm was actually slf4j Logger. But then in other platforms I have to provide that actual interface by hand (no lib match that interface). I wonder if I am doing something wrong, or if there is a way to tell multiplatform to use the expected interface "as is"
v
I think that if you have
expect interface
, than you must provide
actuals
for each platform. I don't understand what you mean by
if there is a way to tell multiplatform to use the expected interface "as is"
You need to provide actual. Is it problem of having different but similar targets having the same
actual
, thus making you duplicate the code?
o
Since it's an interface not impl, in many cases expected and actual is exactly the same