I love the "toString" and "equals/toHashcode" functions from the data class but don't want to use them in the public API of a library for binary compatibility reasons. Is there any easy way to get the best of both worlds?
Indeed, Poko for the win! The alternative is to expose an interface and have an internal/private data class that implements the interface. A bit more verbose than Poko but doesn’t require the extra dep (I’ll sometimes do this for smaller projects).
gratitude thank you 1
n
nkiesel
02/04/2025, 12:28 AM
What is the best way to suppress the “unsafe internal compiler arguments” warning for Kotlin 2.x? I’m using the WhenGuards among some other 2.x features for some non-production code. I tried adding “kotlin.compiler.arguments.suppress.internal=true” to gradle.properties but that does not work.