fabianhjr
07/30/2022, 1:36 AM// ^ Try different backends
// v And commenting out or not
// @JvmInline
value class NonEmptyString(val value: String) {
init {
require(value.isNotEmpty())
}
}
fun main() {
println(NonEmptyString("Hello"))
try {
println(NonEmptyString(""))
} catch(e: Throwable) {
println("Woops!")
}
}
Slack ConversationMichael Paus
07/30/2022, 8:24 AMimport kotlin.jvm.JvmInline
your code compiles and runs just fine on iOS and on JS where it should not be runnable according to your statements.