[swift-evolution] Type-safe selectors

Michel Fortin michel.fortin at michelf.ca
Fri Dec 4 17:00:05 CST 2015


Le 4 déc. 2015 à 17:31, Joe Groff <jgroff at apple.com> a écrit :

> One wrinkle you need to consider is the different ARC behavior of method families. @convention(selector) would have to be restricted to referencing methods that don't belong to an usual method family or have unusual ownership rules, or else we'd need multiple @convention(init_selector), (copy_selector), (alloc_selector) etc. conventions.

Very true. Still, people currently pass selectors around without really bothering about this. It seems to me that restricting @convention(selector) to represent methods having standard behaviour (standard being autoreleased-return with non-consuming arguments) would cover about 99.9% of the use cases.

-- 
Michel Fortin
michel.fortin at michelf.ca
https://michelf.ca



More information about the swift-evolution mailing list