DiscriminatedUnion Protocol

Thank you for the feedback.

  • I'm not sure what you mean by 'blindly' transition, here. I guess you mean that the API exposed to the end user doesn't–somehow–guard at compile time? I'd like that and have a few ideas that could address the concern but those are… larger requests. ([Proposal] Enum subsets for example)
  • If you run the example that I've provided… it does a runtime check. 'automatically'. That is useful
  • The example that you've given seems valid and good which makes it seem like the motivation in the pitch did, at least, convey a bit of the core value in the proposal