<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div>I don't know if there has been any internal discussion about using union-types instead of enums, but afaics, there are no obvious downsides for that approach.</div><div><br class=""><blockquote type="cite" class=""><div class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">I'm a little curious as to why union types keep on coming up, when enums can do everything they can and much more (methods, constraints on generic types, conformance to protocols).</span><br class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></div></blockquote></div>Are there any strong reasons why those features would not be possible with union types?<div class=""><br class=""></div><div class="">There has been a discussion started because it is a little bit cumbersome to create enum-properties (and methods).</div><div class="">With unions, there would be no need for all those switch-statements, and would be possible to configure cases in a central location.</div><div class="">There has also been a proposal for "anonymous enums", which could be modeled with unions in a very elegant way.</div></body></html>