I've got a JVM project where I define an interface...
# announcements
c
I've got a JVM project where I define an interface, now I'm creating a kotlin JS project where I'd like to implement the interface. But IntelliJ doesn't seem to resolve the dependency. Do dependencies of a Kotlin JS project have to be JS dependencies too?
I think I need my interface in a kotlin-common project, not JVM?
h
Yes, that's the answer
m
yes, that interface must be declared with the
expect
modifier and a platform-specific implementation with
actual
: https://kotlinlang.org/docs/reference/multiplatform.html#how-it-works
a
Or the interface can simply be defined in common, and the implementation defined in the platform subproject: you don’t need expect/actual for that
☝️ 1