https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
t

Thiago

03/06/2024, 5:29 PM
hey folks, I've been a while without the error
Conflicting overloads
when I'm using
expect/actual
in a module that have
jvm
and
android
targets. Today I found that this error still happening and I would like to know if Kotlin has solved yet or what is the best approach to avoid it?
Copy code
// common
expect fun doSomething()

// jvm
actual fun doSomething()

// android
actual fun doSomething() <- Conflicting overloads
Compiler still forcing to implement the
actual
but don't build and report
Conflicting overloads
m

Matt Nelson

03/06/2024, 10:14 PM
You need an intermediate source set for which
jvm
and
android
inherit from e.g.
Copy code
commonMain
  |
  |--- jvmAndroidMain
  |       |--- androidMain
  |       '--- jvmMain
  '--- nonJvmMain
          |...
👍 1
2 Views