mir-core
mir-core copied to clipboard
provide `assertMatch`
In D it is not possible to write:
value.match!((A a) => a, (_) =>assert(false))
instead of using trymatch or a nullable I think it would be useful to have an assertMatch that raises an exception when the type can't be handled. Possibly you can come up with a better name than assertMatch.
@FraMecca what is the difference between tryMatch and assertMatch? tryMatch throws an exception too.