Swift: Swift lacks message passing

Originator:thebuckley
Number:rdar://17141387 Date Originated:04-Jun-2014 00:49 AM
Status:Open Resolved:
Product:Developer Tools Product Version:
Classification: Reproducible:N/A
 
Message passing has been one of the most powerful features of Objective-C. Although Swift objects which inherit from Objective-C still use message passing for Objective-C compatible functions, looking forward to a world where Apple frameworks have been rewritten in Swift and Objective-C is deprecated, it would be a shame to lose this functionality.

There are various ways this could be implemented. Here are some suggestions in my personal priority order:

1. Vtable dispatch is replaced with message passing
2. Classes can opt-in to message passing at runtime (and extensions can opt their classes into message passing)
3. A special Swift class that imparts message passing to its subclasses
4. A separate type from regular classes that supports message passing

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!