<@U0NJFGERK>: if you don’t need exhaustive `when`,...
# getting-started
o
@vint: if you don’t need exhaustive
when
, you can just use
object
instead of enum, and then use extension properties to add some more.
Copy code
class Currency(val sign: String) {
    companion object {
        val USD = Currency("$")
        val GBP = Currency("£")
        val THB = Currency("฿")
    }
}

// in some other place, even other module
val Currency.Companion.EUR: Currency get() = Currency("€")

fun test() {
    val c1 = Currency.USD
    val c2 = Currency.EUR
}
👍 4