<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Apr 19, 2016, at 7:28 AM, Greg Parker <<a href="mailto:gparker@apple.com" class="">gparker@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Apr 18, 2016, at 8:21 PM, Joe Pamer via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""></div><div class="">I propose that we fully eliminate implicit bridging conversions in Swift 3. This would mean that some users might have to introduce introduce a few more ‘as’ casts in their code, but we would remove another special case from Swift's type system and be able to further simplify the compiler. If anyone is curious and would like to take this model for a spin, I’ve pushed an experimental branch that implements this proposed change, <font face="Menlo" class="">inhibit-implicit-conversions</font>.</div></div></div></blockquote><br class=""></div><div class="">What happens with string literals? Are they implicitly converted to NSString as necessary?</div></div></div></blockquote><div><br class=""></div><div>Sort of - yes. The types of literal expressions are always inferred from context, so for string literals they will be inferred as NSString or String as necessary. </div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Which of the following will be legal?</div><div class=""><br class=""></div><div class=""> import Foundation</div><div class=""> func s(_ str: String) { }</div><div class=""> func ns(_ str: NSString) { }</div><div class=""><br class=""></div><div class=""> let str: String = "foo"</div><div class=""> let nsstr: NSString = "foo"</div><div class=""><br class=""></div><div class=""> NSLog("foo”)</div></div></div></blockquote><div><br class=""></div>legal</div><div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""> NSLog(str)</div></div></div></blockquote><div><br class=""></div><div>legal - the NSLog initializer is imported as having type <font face="Menlo" class="">func NSLog(_ format: String, _ args: CVarArg...)</font></div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""> NSLog(nstr)</div></div></div></blockquote><div><br class=""></div><div>illegal, per the imported initializer declaration above</div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""></div><div class=""><div class=""> s("foo”)</div></div></div></div></blockquote><div><br class=""></div><div>legal</div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><div class=""> s(str)</div></div></div></div></blockquote><div><br class=""></div><div>legal</div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><div class=""> s(nsstr)</div></div></div></div></blockquote><div><br class=""></div><div>illegal</div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><div class=""><br class=""></div><div class=""><div class=""> ns("foo”)</div></div></div></div></div></blockquote><div><br class=""></div>legal</div><div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><div class=""><div class=""> ns(str)</div></div></div></div></div></blockquote><div><br class=""></div>illegal</div><div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><div class=""><div class=""> ns(nsstr)</div></div></div></div></div></blockquote><div><br class=""></div><div>legal</div><div><br class=""></div><div>Thanks,</div><div>- Joe</div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><div class=""><br class=""></div></div><div class="">-- </div><div class="">Greg Parker <a href="mailto:gparker@apple.com" class="">gparker@apple.com</a> Runtime Wrangler</div><div class=""><br class=""></div><div class=""><br class=""></div></div></div></blockquote></div><br class=""></body></html>