Open Alex009 opened 3 years ago
I've made a generator to avoid default on enum. You can check it here. It produce extension like below
public extension shared.SpaceState.Status {
var `enum`: SpaceState.Status.Enum {
if self == shared.SpaceState.Status.idle {
return .idle
} else if self == shared.SpaceState.Status.pending {
return .pending
} else {
fatalError("SpaceState.Status not synchronized")
}
}
enum Enum {
case idle
case pending
}
}
Is it what you had in mind ? Do you want a PR ?
yes, it is. please create PR 👍
@cl3m please submit a PR 👍
to support exhaustive whens/switches for Kotlin enums (either via a generated extension with blocks for every case, or maybe something like this)