I'm building a shared library, based only on Kotli...
# multiplatform
g
I'm building a shared library, based only on Kotlin "native" code, no JVM class references allowed (JVM used for test execution). gradle.properties:
Copy code
ksp.useKSP2=true
build.gradle.kts:
Copy code
kotlin("jvm") version "2.2.0"
id("com.google.devtools.ksp") version "2.2.20-2.0.4" // KSP for Kotlin 2.2.0
ChatGPT just told me that default methods in interfaces is not supported in Kotlin "native" code. While I currently have one default method in an interface, I can remove it, if I need to, and then won't create any more! So, my question: Is ChatGPT wrong, and default methods in interfaces are supported?
m
You can use default methods in interfaces in Kotlin native. My guess is that ChatGPT is saying that they are not supported when implementing the interface in Objective-C or Swift.
g
Thanks, that was my hope! I don't use default methods very often, but when they make sense it reduces code duplication &/ more inheritance! Thx again