I imagine something like this ``` enum MyEnum { ...
# announcements
i
I imagine something like this
Copy code
enum MyEnum {
    FOO, BAR
    constructor(string): MyEnum? { when (string) "x" -> FOO, "y" -> BAR, else -> null }
}