> On Dec 12, 2016, at 2:12 PM, Charles Srstka via swift-evolution 
> <[email protected]> wrote:
> 
> print((c as AnyObject?)?.bar() as Any) // Optional(6)
> print((s as AnyObject?)?.bar() as Any) // crash! -[_SwiftValue bar]: 
> unrecognized selector sent to instance 0x5432109876543210

All right, immediately after sending this, I realized what was wrong with this; 
bar() should have been bar?(). If the question mark is added, the last line 
returns nil instead of crashing. The rest of my questions still stand, and we 
can add to the list why the above doesn’t raise a compiler warning.

Charles

_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to