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.
In D it is not possible to write:
instead of using trymatch or a nullable I think it would be useful to have an
assertMatchthat raises an exception when the type can't be handled. Possibly you can come up with a better name thanassertMatch.