Open Tapchicoma opened 10 months ago
The current workaround is to provides a bridge layer of actual / expect (https://github.com/SimonMarquis/SealedObjectInstances/pull/163/commits/295938412c43e0d1271ea6f75fe308138c817efc)
// src/commonMain/kotlin/com/example/Entity.kt
internal expect fun Entity.Companion.all(): Set<Entity>
// src/jvmMain/kotlin/com/example/Entity.jvm.kt
internal actual fun Entity.Companion.all(): Set<Entity> = sealedObjectInstances()
Note that the workaround mentioned here does not seem to work:
Originally reported in Kotlin bug tracker here
In Kotlin multiplatform module that depends on SealedObjectInstances KSP library to generate the sealedObjectInstances() extension on the Entity Companion object build fails with Kotlin 2.0.0-Beta1 and KSP 2.0.0-Beta1-1.0.15 versions:
Repro is available here: https://github.com/SimonMarquis/SealedObjectInstances/pull/163