[swift-evolution] Pitch: really_is and really_as operators

Charles Srstka cocoadev at charlessoft.com
Wed Aug 24 21:58:53 CDT 2016


> On Aug 24, 2016, at 9:51 PM, Xiaodi Wu <xiaodi.wu at gmail.com> wrote:
> 
> On Wed, Aug 24, 2016 at 9:47 PM, Xiaodi Wu <xiaodi.wu at gmail.com <mailto:xiaodi.wu at gmail.com>> wrote:
> Works on Linux :)
> 
> And besides, on any platform where `type(of: bar) != NSString`, why should you expect `bar really_is NSString == true`? Isn't bar *not really* NSString?

Because the pitch was for a version of ‘is’ which lacks the Objective-C bridging. The ‘is’ keyword matches subclasses of the type you specify as well as the type itself.

Charles

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160824/2308c53e/attachment.html>


More information about the swift-evolution mailing list