<html><head><style>body{font-family:Helvetica,Arial;font-size:13px}</style></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">Definitely a welcome change from me (+1). But this proposal makes me curious about the impact on the `AnyObject` protocol?</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="margin: 0px;"><p style="font-family: 'Source Code Pro'; font-size: 11px; margin: 0px; line-height: normal;"><span style="color: rgb(253, 68, 133); font-variant-ligatures: no-common-ligatures;">let</span><span style="font-variant-ligatures: no-common-ligatures;"> string =<font color="#f9f9f5"> </font></span><span style="font-variant-ligatures: no-common-ligatures;"><font color="#ff9300">"foo"</font></span></p>
<p style="font-family: 'Source Code Pro'; font-size: 11px; margin: 0px; line-height: normal;"><span style="color: rgb(253, 68, 133); font-variant-ligatures: no-common-ligatures;">let</span><span style="font-variant-ligatures: no-common-ligatures;"> nsString = </span><span style="font-variant-ligatures: no-common-ligatures;"><font color="#00fa92">string</font></span><span style="color: rgb(249, 249, 245); font-variant-ligatures: no-common-ligatures;"> </span><span style="color: rgb(253, 68, 133); font-variant-ligatures: no-common-ligatures;">as</span><span style="color: rgb(249, 249, 245); font-variant-ligatures: no-common-ligatures;"> </span><span style="font-variant-ligatures: no-common-ligatures;"><font color="#0096ff">AnyObject</font></span></p>
<p style="font-family: 'Source Code Pro'; font-size: 11px; margin: 0px; line-height: normal;"><span style="color: rgb(0, 250, 146); font-variant-ligatures: no-common-ligatures;">nsString</span><span style="font-variant-ligatures: no-common-ligatures;">.</span><span style="color: rgb(253, 68, 133); font-variant-ligatures: no-common-ligatures;">dynamicType</span><span style="color: rgb(249, 249, 245); font-variant-ligatures: no-common-ligatures;"> </span><span style="color: rgb(76, 76, 76); font-variant-ligatures: no-common-ligatures;">// _NSCFConstantString.Type</span></p>
<p style="font-family: 'Source Code Pro'; font-size: 11px; margin: 0px; line-height: normal;"><span style="font-variant-ligatures: no-common-ligatures;"><font color="#0096ff">NSString</font></span><span style="font-variant-ligatures: no-common-ligatures;">().</span><span style="color: rgb(253, 68, 133); font-variant-ligatures: no-common-ligatures;">dynamicType</span><span style="color: rgb(249, 249, 245); font-variant-ligatures: no-common-ligatures;"> </span><span style="color: rgb(76, 76, 76); font-variant-ligatures: no-common-ligatures;">// __NSCFConstantString.Type // there are two different types?&nbsp;</span></p><p style="font-family: 'Source Code Pro'; font-size: 11px; margin: 0px; line-height: normal;"><span style="color: rgb(76, 76, 76); font-variant-ligatures: no-common-ligatures;"><br></span></p><p style="margin: 0px; line-height: normal;"><font face="Helvetica">This sample won’t bridge anymore if SE-0083 will be accepted. Can we also drop the @objc from `AnyObject` protocol and leave it as an implicit protocol for classes? (Personally I’d rename `AnyObject` to `AnyReference` if Swift will introduce other reference types.)</font></p><p style="margin: 0px; line-height: normal;"><font face="Helvetica"><br></font></p><p style="margin: 0px; line-height: normal;"><font face="Helvetica">This change might allow the replacement of the `class` keyword from protocols with the implicit `AnyObject` protocol, which can be discussed in this thread:&nbsp;</font><span style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium;"><a href="https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160502/016286.html">Should we rename "class" when referring to        protocol conformance?</a></span></p><p style="margin: 0px; line-height: normal;"><br></p><p style="margin: 0px; line-height: normal;">One more thing I’d like to ask: is there any possibility of adding a new `bridge` keyword, which would allow explicit bridging to a different language type (ObjC, etc. if there are any more languages we can bridge to [C or maybe one day C++])?</p><p style="margin: 0px; line-height: normal;"><br></p><p style="margin: 0px; line-height: normal;">T `bridge` U</p><p style="margin: 0px; line-height: normal;">T? `bridge` U?</p><p style="margin: 0px; line-height: normal;"><br></p><p style="margin: 0px; line-height: normal;">Wouldn’t this move the bridging mechanism to its own area?</p><p style="margin: 0px; line-height: normal;"><br></p><p style="margin: 0px; line-height: normal;">The ugly NSError pattern could be rewritten and migrated to:</p><p style="margin: 0px; line-height: normal;"><br></p><p style="margin: 0px; line-height: normal;"><span style="font-family: 'helvetica Neue', helvetica;">do {</span><br style="font-family: 'helvetica Neue', helvetica;"><span style="font-family: 'helvetica Neue', helvetica;">&nbsp; &nbsp;try something()</span><br style="font-family: 'helvetica Neue', helvetica;"><span style="font-family: 'helvetica Neue', helvetica;">} catch let error {</span><br style="font-family: 'helvetica Neue', helvetica;"><span style="font-family: 'helvetica Neue', helvetica;">&nbsp; &nbsp;handle(</span><span style="font-family: 'helvetica Neue', helvetica;">error `bridge` NSError</span><span style="font-family: 'helvetica Neue', helvetica;">)</span></p><p style="margin: 0px; line-height: normal;"><span style="font-family: 'helvetica Neue', helvetica;">}</span></p><p style="margin: 0px; line-height: normal;"><br></p></div> Is such a change complicated, what do you think?<div><br> <div id="bloop_sign_1462516268647008000" class="bloop_sign"><div style="font-family:helvetica,arial;font-size:13px">--&nbsp;<br>Adrian Zubarev<br>Sent with Airmail</div></div> <br><p class="airmail_on">Am 4. Mai 2016 bei 01:50:54, Joe Groff via swift-evolution (<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>) schrieb:</p> <blockquote type="cite" class="clean_bq"><span><div><div></div><div>Thanks everyone for the initial round of feedback. I've submitted a draft proposal:<br><br>https://github.com/apple/swift-evolution/pull/289<br>https://github.com/jckarter/swift-evolution/blob/remove-bridging-conversion-dynamic-casts/proposals/XXXX-remove-bridging-from-dynamic-casts.md<br><br>-Joe<br>_______________________________________________<br>swift-evolution mailing list<br>swift-evolution@swift.org<br>https://lists.swift.org/mailman/listinfo/swift-evolution<br></div></div></span></blockquote></div></body></html>