<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><blockquote type="cite" class="">On Jul 1, 2016, at 2:08 AM, Cao Jiannan via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:<br class=""><br class=""><br class=""><br class="">Hi all,<br class=""><br class="">I'm now officially proposal the union type feature for Swift. Please see:<br class=""><br class=""><br class=""><a href="https://github.com/frogcjn/swift-evolution/blob/master/proposals/xxxx-union-type.md" class="">https://github.com/frogcjn/swift-evolution/blob/master/proposals/xxxx-union-type.md</a><br class="">Introduction<br class=""><br class="">Add union type grammar, represents the type which is one of other types.<br class=""><br class="">var&nbsp;stringOrURL:&nbsp;String&nbsp;|&nbsp;URL&nbsp;=&nbsp;"https://www.apple.com"<br class=""><br class=""><br class="">I would be thankful if someone support this idea and give some advice. Thanks!<br class=""></blockquote><br class=""><div class="">We touch on this in the "commonly proposed" list:</div><div class=""><br class=""></div><div class=""><a href="https://github.com/apple/swift-evolution/blob/master/commonly_proposed.md" class="">https://github.com/apple/swift-evolution/blob/master/commonly_proposed.md</a></div><div class=""><br class=""></div><div class=""><ul style="box-sizing: border-box; padding-left: 2em; margin-top: 0px; margin-bottom: 16px; color: rgb(51, 51, 51); font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 16px; background-color: rgb(255, 255, 255);" class=""><li style="box-sizing: border-box;" class=""><p style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;" class=""><a href="https://lists.swift.org/pipermail/swift-evolution-announce/2016-June/000182.html" style="box-sizing: border-box; background-color: transparent; -webkit-text-decoration-skip: objects; color: rgb(64, 120, 192); text-decoration: none;" class="">Disjunctions (logical ORs) in type constraints</a>: These include anonymous union-like types (e.g.&nbsp;<code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.600000381469727px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">(Int | String)</code>&nbsp;for a type that can be inhabited by either an integer or a string). "[This type of constraint is] something that the type system cannot and should not support."</p></li></ul><div class=""><br class=""></div></div><div class="">-Joe</div></body></html>