Michael Paus
05/24/2024, 11:08 AMinterface MyService {
fun myServiceMethod(): String
}
expect class MyServiceImpl: MyService
For all targets:
actual class MyServiceImpl : MyService {
override fun myServiceMethod(): String {
TODO("Not yet implemented")
}
}
This compiles without problems with Kotlin 1.9.23 but results in the following error message when I switch to 2.0.0.
> Task :library:compileCommonMainKotlinMetadata FAILED
e: file:[...]/MyServiceImpl.kt:5:8 Class 'MyServiceImpl' is not abstract and does not implement abstract member 'myServiceMethod'.
Has anybody noticed similar problems or knows about an already existing bug report?Andrew Reed
05/24/2024, 11:57 AMstreetsofboston
05/24/2024, 12:06 PMexpect
the myServiceMethod as well.Michael Paus
05/24/2024, 12:47 PMMichael Paus
05/24/2024, 12:49 PMstreetsofboston
05/24/2024, 12:59 PMexpect class MyServiceImpl: MyService {
expect override fun myServiceMethod(): String
}
but this 'work-around' doesn't work, at all... 🙂Michael Paus
05/24/2024, 1:01 PMDmitry Stakhov
05/24/2024, 4:31 PMexpect class MyServiceImpl: MyService {
override fun myServiceMethod(): String
}
actual class MyServiceImpl : MyService {
actual override fun myServiceMethod(): String {
TODO("Not yet implemented")
}
}
Michael Paus
05/24/2024, 4:38 PMVladimir Vainer
08/11/2024, 11:23 AMAlex
08/11/2024, 11:26 AMexpect class
and use an expect interface
with platform specific implementations and expect fun
extensions, jetbrains people said expect class
is tricky and will have bugsAlex
08/11/2024, 11:26 AM