<div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div><span style="font-family: 'PingFang SC';">It is no a mistake. since </span><span style="font-size: 10.5pt; font-family: Helvetica, Tahoma, Arial, PingFang, 苹方, 'Hiragino Sans GB', 冬青黑体, 'Microsoft YaHei', 微软雅黑, SimSun, 宋体, STXihei, 华文细黑, Heiti, 黑体, sans-serif; background-color: rgba(255, 255, 255, 0);">fn1: (A</span><span class="pl-k" style="font-size: 10.5pt; font-family: Helvetica, Tahoma, Arial, PingFang, 苹方, 'Hiragino Sans GB', 冬青黑体, 'Microsoft YaHei', 微软雅黑, SimSun, 宋体, STXihei, 华文细黑, Heiti, 黑体, sans-serif; background-color: rgba(255, 255, 255, 0); box-sizing: border-box;">|</span><span style="font-size: 10.5pt; font-family: Helvetica, Tahoma, Arial, PingFang, 苹方, 'Hiragino Sans GB', 冬青黑体, 'Microsoft YaHei', 微软雅黑, SimSun, 宋体, STXihei, 华文细黑, Heiti, 黑体, sans-serif; background-color: rgba(255, 255, 255, 0);">B)</span><span class="pl-k" style="font-size: 10.5pt; font-family: Helvetica, Tahoma, Arial, PingFang, 苹方, 'Hiragino Sans GB', 冬青黑体, 'Microsoft YaHei', 微软雅黑, SimSun, 宋体, STXihei, 华文细黑, Heiti, 黑体, sans-serif; background-color: rgba(255, 255, 255, 0); box-sizing: border-box;">-></span><span class="pl-c1" style="font-size: 10.5pt; font-family: Helvetica, Tahoma, Arial, PingFang, 苹方, 'Hiragino Sans GB', 冬青黑体, 'Microsoft YaHei', 微软雅黑, SimSun, 宋体, STXihei, 华文细黑, Heiti, 黑体, sans-serif; background-color: rgba(255, 255, 255, 0); box-sizing: border-box;">Void </span><span style="font-size: 10.5pt; font-family: 'PingFang SC';">is subtype of fn0: </span><span style="font-size: 10.5pt; font-family: Helvetica, Tahoma, Arial, PingFang, 苹方, 'Hiragino Sans GB', 冬青黑体, 'Microsoft YaHei', 微软雅黑, SimSun, 宋体, STXihei, 华文细黑, Heiti, 黑体, sans-serif; background-color: rgba(255, 255, 255, 0);">A</span><span class="pl-k" style="font-size: 10.5pt; font-family: Helvetica, Tahoma, Arial, PingFang, 苹方, 'Hiragino Sans GB', 冬青黑体, 'Microsoft YaHei', 微软雅黑, SimSun, 宋体, STXihei, 华文细黑, Heiti, 黑体, sans-serif; background-color: rgba(255, 255, 255, 0); box-sizing: border-box;">-></span><span class="pl-c1" style="font-size: 10.5pt; font-family: Helvetica, Tahoma, Arial, PingFang, 苹方, 'Hiragino Sans GB', 冬青黑体, 'Microsoft YaHei', 微软雅黑, SimSun, 宋体, STXihei, 华文细黑, Heiti, 黑体, sans-serif; background-color: rgba(255, 255, 255, 0); box-sizing: border-box;">Void</span><span style="font-size: 10.5pt; font-family: Helvetica, Tahoma, Arial, PingFang, 苹方, 'Hiragino Sans GB', 冬青黑体, 'Microsoft YaHei', 微软雅黑, SimSun, 宋体, STXihei, 华文细黑, Heiti, 黑体, sans-serif;"> </span></div><div id="isForwardContent"><div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div><div style="font-family: 'PingFang SC';"><br></div><div style="font-family: 'PingFang SC';"><span style="font-size: 10.5pt; font-family: Helvetica, Tahoma, Arial, PingFang, 苹方, 'Hiragino Sans GB', 冬青黑体, 'Microsoft YaHei', 微软雅黑, SimSun, 宋体, STXihei, 华文细黑, Heiti, 黑体, sans-serif;">Detail explain:</span></div><div style="font-family: 'PingFang SC';"><br></div><div style="font-family: 'PingFang SC';"><div style="font-family: Helvetica, Tahoma, Arial, PingFang, 苹方, 'Hiragino Sans GB', 冬青黑体, 'Microsoft YaHei', 微软雅黑, SimSun, 宋体, STXihei, 华文细黑, Heiti, 黑体, sans-serif;"><span class="pl-k" style="background-color: rgba(255, 255, 255, 0); box-sizing: border-box;">var</span> <span style="background-color: rgba(255, 255, 255, 0);">fn0: A</span><span class="pl-k" style="background-color: rgba(255, 255, 255, 0); box-sizing: border-box;">-></span><span class="pl-c1" style="background-color: rgba(255, 255, 255, 0); box-sizing: border-box;">Void</span> <span class="pl-k" style="background-color: rgba(255, 255, 255, 0); box-sizing: border-box;">=</span> <span style="background-color: rgba(255, 255, 255, 0);">{</span><span class="pl-c1" style="background-color: rgba(255, 255, 255, 0); box-sizing: border-box;">print</span><span style="background-color: rgba(255, 255, 255, 0);">($0)} </span></div></div><div style="font-family: Helvetica, Tahoma, Arial, PingFang, 苹方, 'Hiragino Sans GB', 冬青黑体, 'Microsoft YaHei', 微软雅黑, SimSun, 宋体, STXihei, 华文细黑, Heiti, 黑体, sans-serif;"><span class="pl-k" style="background-color: rgba(255, 255, 255, 0); box-sizing: border-box;">var</span> <span style="background-color: rgba(255, 255, 255, 0);">fn1: (A</span><span class="pl-k" style="background-color: rgba(255, 255, 255, 0); box-sizing: border-box;">|</span><span style="background-color: rgba(255, 255, 255, 0);">B)</span><span class="pl-k" style="background-color: rgba(255, 255, 255, 0); box-sizing: border-box;">-></span><span class="pl-c1" style="background-color: rgba(255, 255, 255, 0); box-sizing: border-box;">Void</span> <span class="pl-k" style="background-color: rgba(255, 255, 255, 0); box-sizing: border-box;">=</span> <span style="background-color: rgba(255, 255, 255, 0);">{</span><span class="pl-c1" style="background-color: rgba(255, 255, 255, 0); box-sizing: border-box;">print</span><span style="background-color: rgba(255, 255, 255, 0);">(v0)} </span></div><div style="font-family: Helvetica, Tahoma, Arial, PingFang, 苹方, 'Hiragino Sans GB', 冬青黑体, 'Microsoft YaHei', 微软雅黑, SimSun, 宋体, STXihei, 华文细黑, Heiti, 黑体, sans-serif;"><span style="background-color: rgba(255, 255, 255, 0);">let a = A()</span></div><div style="font-family: Helvetica, Tahoma, Arial, PingFang, 苹方, 'Hiragino Sans GB', 冬青黑体, 'Microsoft YaHei', 微软雅黑, SimSun, 宋体, STXihei, 华文细黑, Heiti, 黑体, sans-serif;"><span style="background-color: rgba(255, 255, 255, 0);">let b = B()</span></div><div style="font-family: Helvetica, Tahoma, Arial, PingFang, 苹方, 'Hiragino Sans GB', 冬青黑体, 'Microsoft YaHei', 微软雅黑, SimSun, 宋体, STXihei, 华文细黑, Heiti, 黑体, sans-serif;"><span style="background-color: rgba(255, 255, 255, 0);"><br></span></div><div style="font-family: Helvetica, Tahoma, Arial, PingFang, 苹方, 'Hiragino Sans GB', 冬青黑体, 'Microsoft YaHei', 微软雅黑, SimSun, 宋体, STXihei, 华文细黑, Heiti, 黑体, sans-serif;"><span style="background-color: rgba(255, 255, 255, 0);">So:</span></div><div style="font-family: Helvetica, Tahoma, Arial, PingFang, 苹方, 'Hiragino Sans GB', 冬青黑体, 'Microsoft YaHei', 微软雅黑, SimSun, 宋体, STXihei, 华文细黑, Heiti, 黑体, sans-serif;"><br></div><div style="font-family: 'PingFang SC';"><span style="font-size: 10.5pt; font-family: Helvetica, Tahoma, Arial, PingFang, 苹方, 'Hiragino Sans GB', 冬青黑体, 'Microsoft YaHei', 微软雅黑, SimSun, 宋体, STXihei, 华文细黑, Heiti, 黑体, sans-serif;">fn0( a ) // this is OK </span></div><div style="font-family: 'PingFang SC';"><span style="font-size: 10.5pt; font-family: Helvetica, Tahoma, Arial, PingFang, 苹方, 'Hiragino Sans GB', 冬青黑体, 'Microsoft YaHei', 微软雅黑, SimSun, 宋体, STXihei, 华文细黑, Heiti, 黑体, sans-serif;">fn1( a ) // this is also OK</span></div><div style="font-family: 'PingFang SC';"><br></div><div style="font-family: 'PingFang SC';"><span style="font-family: Helvetica, Tahoma, Arial, PingFang, 苹方, 'Hiragino Sans GB', 冬青黑体, 'Microsoft YaHei', 微软雅黑, SimSun, 宋体, STXihei, 华文细黑, Heiti, 黑体, sans-serif;">fn1 is subtype of fn0, because </span><span style="font-family: Helvetica, Tahoma, Arial, PingFang, 苹方, 'Hiragino Sans GB', 冬青黑体, 'Microsoft YaHei', 微软雅黑, SimSun, 宋体, STXihei, 华文细黑, Heiti, 黑体, sans-serif; font-size: 10.5pt;">fn1 can do anything fn0 do.</span></div><div style="font-family: 'PingFang SC';"><span style="font-family: Helvetica, Tahoma, Arial, PingFang, 苹方, 'Hiragino Sans GB', 冬青黑体, 'Microsoft YaHei', 微软雅黑, SimSun, 宋体, STXihei, 华文细黑, Heiti, 黑体, sans-serif; font-size: 10.5pt;">Thus fn0 = fn1 is OK.</span></div><div style="font-family: 'PingFang SC';"><span style="font-family: Helvetica, Tahoma, Arial, PingFang, 苹方, 'Hiragino Sans GB', 冬青黑体, 'Microsoft YaHei', 微软雅黑, SimSun, 宋体, STXihei, 华文细黑, Heiti, 黑体, sans-serif; font-size: 10.5pt;"><br></span></div><div style="font-family: 'PingFang SC';"><font face="Helvetica, Tahoma, Arial, PingFang, 苹方, Hiragino Sans GB, 冬青黑体, Microsoft YaHei, 微软雅黑, SimSun, 宋体, STXihei, 华文细黑, Heiti, 黑体, sans-serif">But:</font></div><div style="font-family: 'PingFang SC';"><font face="Helvetica, Tahoma, Arial, PingFang, 苹方, Hiragino Sans GB, 冬青黑体, Microsoft YaHei, 微软雅黑, SimSun, 宋体, STXihei, 华文细黑, Heiti, 黑体, sans-serif"><br></font></div><div style="font-family: 'PingFang SC';"><font face="Helvetica, Tahoma, Arial, PingFang, 苹方, Hiragino Sans GB, 冬青黑体, Microsoft YaHei, 微软雅黑, SimSun, 宋体, STXihei, 华文细黑, Heiti, 黑体, sans-serif">fn1( b ) // this is OK</font></div><div style="font-family: 'PingFang SC';"><font face="Helvetica, Tahoma, Arial, PingFang, 苹方, Hiragino Sans GB, 冬青黑体, Microsoft YaHei, 微软雅黑, SimSun, 宋体, STXihei, 华文细黑, Heiti, 黑体, sans-serif">fn0( b ) // this is not OK</font></div><div style="font-family: 'PingFang SC';"><br></div><div style="font-family: 'PingFang SC';"><font face="Helvetica, Tahoma, Arial, PingFang, 苹方, Hiragino Sans GB, 冬青黑体, Microsoft YaHei, 微软雅黑, SimSun, 宋体, STXihei, 华文细黑, Heiti, 黑体, sans-serif">So fn0 is not subtype of fn1</font></div></div><div style="position:relative;zoom:1"></div><div></div><div><br></div>At 2016-08-11 10:41:02, "Step C" <<a href="mailto:schristopher@bignerdranch.com">schristopher@bignerdranch.com</a>> wrote:<br> <blockquote id="isReplyContent" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><div></div><div>Shouldn't it be "fn1 = fn0"? Same for the fn2 statements. </div><div><br></div><div>`<span class="pl-k" style="background-color: rgba(255, 255, 255, 0); box-sizing: border-box;">var</span><span style="background-color: rgba(255, 255, 255, 0);"> fn0: A</span><span class="pl-k" style="background-color: rgba(255, 255, 255, 0); box-sizing: border-box;">-></span><span class="pl-c1" style="background-color: rgba(255, 255, 255, 0); box-sizing: border-box;">Void</span><span style="background-color: rgba(255, 255, 255, 0);"> </span><span class="pl-k" style="background-color: rgba(255, 255, 255, 0); box-sizing: border-box;">=</span><span style="background-color: rgba(255, 255, 255, 0);"> {</span><span class="pl-c1" style="background-color: rgba(255, 255, 255, 0); box-sizing: border-box;">print</span><span style="background-color: rgba(255, 255, 255, 0);">(v0)} </span></div><div><span style="background-color: rgba(255, 255, 255, 0);"></span><span class="pl-k" style="background-color: rgba(255, 255, 255, 0); box-sizing: border-box;">var</span><span style="background-color: rgba(255, 255, 255, 0);"> fn1: (A</span><span class="pl-k" style="background-color: rgba(255, 255, 255, 0); box-sizing: border-box;">|</span><span style="background-color: rgba(255, 255, 255, 0);">B)</span><span class="pl-k" style="background-color: rgba(255, 255, 255, 0); box-sizing: border-box;">-></span><span class="pl-c1" style="background-color: rgba(255, 255, 255, 0); box-sizing: border-box;">Void</span><span style="background-color: rgba(255, 255, 255, 0);"> </span><span class="pl-k" style="background-color: rgba(255, 255, 255, 0); box-sizing: border-box;">=</span><span style="background-color: rgba(255, 255, 255, 0);"> {</span><span class="pl-c1" style="background-color: rgba(255, 255, 255, 0); box-sizing: border-box;">print</span><span style="background-color: rgba(255, 255, 255, 0);">(v0)} </span></div><div><span style="background-color: rgba(255, 255, 255, 0);"><br></span></div><div><span style="background-color: rgba(255, 255, 255, 0);"> fn0 </span><span class="pl-k" style="background-color: rgba(255, 255, 255, 0); box-sizing: border-box;">=</span><span style="background-color: rgba(255, 255, 255, 0);"> fn1 </span><span class="pl-c" style="background-color: rgba(255, 255, 255, 0); box-sizing: border-box;">// OK, because Original Type and Union Type has a sub-typing relationship</span><span style="background-color: rgba(255, 255, 255, 0);">
</span><span class="pl-k" style="background-color: rgba(255, 255, 255, 0); box-sizing: border-box;">var</span><span style="background-color: rgba(255, 255, 255, 0);"> </span></div><div><span style="background-color: rgba(255, 255, 255, 0);"><br></span></div><div><span style="background-color: rgba(255, 255, 255, 0);">fn2: (A</span><span class="pl-k" style="background-color: rgba(255, 255, 255, 0); box-sizing: border-box;">|</span><span style="background-color: rgba(255, 255, 255, 0);">B</span><span class="pl-k" style="background-color: rgba(255, 255, 255, 0); box-sizing: border-box;">|</span><span style="background-color: rgba(255, 255, 255, 0);">C)</span><span class="pl-k" style="background-color: rgba(255, 255, 255, 0); box-sizing: border-box;">-></span><span class="pl-c1" style="background-color: rgba(255, 255, 255, 0); box-sizing: border-box;">Void</span><span style="background-color: rgba(255, 255, 255, 0);"> </span><span class="pl-k" style="background-color: rgba(255, 255, 255, 0); box-sizing: border-box;">=</span><span style="background-color: rgba(255, 255, 255, 0);"> {</span><span class="pl-c1" style="background-color: rgba(255, 255, 255, 0); box-sizing: border-box;">print</span><span style="background-color: rgba(255, 255, 255, 0);">($</span><span class="pl-c1" style="background-color: rgba(255, 255, 255, 0); box-sizing: border-box;">0</span><span style="background-color: rgba(255, 255, 255, 0);">)} </span></div><div><span style="background-color: rgba(255, 255, 255, 0);"><br></span></div><div><span style="background-color: rgba(255, 255, 255, 0);"> fn0 </span><span class="pl-k" style="background-color: rgba(255, 255, 255, 0); box-sizing: border-box;">=</span><span style="background-color: rgba(255, 255, 255, 0);"> fn2 </span><span class="pl-c" style="background-color: rgba(255, 255, 255, 0); box-sizing: border-box;">// OK</span><span style="background-color: rgba(255, 255, 255, 0);"> </span></div><div><span style="background-color: rgba(255, 255, 255, 0);"> fn1 </span><span class="pl-k" style="background-color: rgba(255, 255, 255, 0); box-sizing: border-box;">=</span><span style="background-color: rgba(255, 255, 255, 0);"> fn2 </span><span class="pl-c" style="background-color: rgba(255, 255, 255, 0); box-sizing: border-box;">// OK`</span></div><div><br>On Aug 10, 2016, at 9:28 PM, Cao Jiannan via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br><br></div><blockquote type="cite"><div><div class="">Hi all,</div><div class=""><br class=""></div><div class="">I want to make a discussion about union type for swift 4.</div><div class="">See <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></div><div class=""><br class=""></div><div class=""><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 16px; background-color: rgb(255, 255, 255);" class="">Add union type grammar, represents the type which is one of other types.</p><div class="highlight highlight-source-swift" style="box-sizing: border-box; margin-bottom: 16px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 16px; background-color: rgb(255, 255, 255);"><pre style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.600000381469727px; margin-top: 0px; margin-bottom: 0px; line-height: 1.45; word-wrap: normal; padding: 16px; overflow: auto; background-color: rgb(247, 247, 247); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-break: normal;" class=""><span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">var</span> stringOrURL: <span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 134, 179);">String</span> <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">|</span> URL <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">=</span> <span class="pl-s" style="box-sizing: border-box; color: rgb(24, 54, 145);"><span class="pl-pds" style="box-sizing: border-box;">"</span><a href="https://www.apple.com" class="">https://www.apple.com</a><span class="pl-pds" style="box-sizing: border-box;">"</span></span></pre></div><div class=""><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 16px; background-color: rgb(255, 255, 255);" class="">Now, if we using the new union type feature, we can declare type conveniently, No other type declaration, and compiler will automatically calculate the common interface.</p><div class="highlight highlight-source-swift" style="box-sizing: border-box; margin-bottom: 16px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 16px; background-color: rgb(255, 255, 255);"><pre style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.600000381469727px; margin-top: 0px; margin-bottom: 0px; line-height: 1.45; word-wrap: normal; padding: 16px; overflow: auto; background-color: rgb(247, 247, 247); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-break: normal;" class=""><span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">func</span> <span class="pl-en" style="box-sizing: border-box; color: rgb(121, 93, 163);">input</span>(value: A <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">|</span> B <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">|</span> C) {
<span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 134, 179);">print</span>(value<span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">.</span>commonProperty) <span class="pl-c" style="box-sizing: border-box; color: rgb(150, 152, 150);">// type checker will calculate the common interface, developer just use it out of box</span>
<span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">switch</span> value {
<span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">case</span> <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">let</span> value <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">as</span> A:
<span class="pl-c" style="box-sizing: border-box; color: rgb(150, 152, 150);">// value is type A</span>
<span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 134, 179);">print</span>(value<span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">.</span>propertyInA)
<span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">case</span> <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">let</span> value <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">as</span> B:
<span class="pl-c" style="box-sizing: border-box; color: rgb(150, 152, 150);">// value is type B</span>
<span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 134, 179);">print</span>(value<span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">.</span>propertyInB)
<span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">case</span> <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">let</span> value <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">as</span> C:
<span class="pl-c" style="box-sizing: border-box; color: rgb(150, 152, 150);">// value is type C</span>
<span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 134, 179);">print</span>(value<span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">.</span>propertyInC)
}
<span class="pl-c" style="box-sizing: border-box; color: rgb(150, 152, 150);">// there is no default case other than A, B or C. we already declared that.</span>
}</pre></div><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 16px; background-color: rgb(255, 255, 255);" class="">Note: A, B, C can be either class or protocol, or any other types. This leaves developer more freedom.</p><div class=""><br class=""></div><div class=""><h2 style="box-sizing: border-box; margin-top: 24px; margin-bottom: 16px; line-height: 1.25; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; background-color: rgb(255, 255, 255);" class="">Impact on existing code</h2><ul style="box-sizing: border-box; padding-left: 2em; margin-top: 0px; color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 16px; background-color: rgb(255, 255, 255); margin-bottom: 0px !important;" class=""><li style="box-sizing: border-box;" class="">This is a new feature, developer who need declare common type will alter to this new grammar.</li><li style="box-sizing: border-box; margin-top: 0.25em;" class="">Enum based version optional or IUO will be replaced by Union-based ones. Any optional type will automatically replaced by union type</li></ul><div class=""><br class=""></div></div><h2 style="box-sizing: border-box; margin-top: 24px; margin-bottom: 16px; line-height: 1.25; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); color: rgb(51, 51, 51); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; background-color: rgb(255, 255, 255);" class=""><a id="user-content-detailed-design" class="anchor" href="https://github.com/frogcjn/swift-evolution/blob/master/proposals/xxxx-union-type.md#detailed-design" aria-hidden="true" style="box-sizing: border-box; background-color: transparent; -webkit-text-decoration-skip: objects; color: rgb(64, 120, 192); text-decoration: none; float: left; padding-right: 4px; margin-left: -20px; line-height: 1;"></a></h2></div></div></div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>swift-evolution mailing list</span><br><span><a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a></span><br><span><a href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br></div></blockquote></blockquote></div><br><br><span title="neteasefooter"><p> </p></span></div></div><br><br><span title="neteasefooter"><p> </p></span>