[swift-evolution] Binding generic types using a metatype parameter

Joe Groff jgroff at apple.com
Fri Mar 25 14:42:31 CDT 2016


> On Mar 25, 2016, at 12:39 PM, Joanna Carter <joanna at carterconsulting.org.uk> wrote:
> 
> 
>> You'd need to extend Int to conform to the protocol for the cast to succeed.
> 
> Ah, yes. And there lies the reason behind wanting to be able to extend Any - avoiding having to extend every possible type likely to be used - mutter, mutter ;-)
> 
> Is it worth putting i a formal proposal for the extension of Any, or has that already been done?


You could. For this particular use case, though, I think we really just want a more direct way of using *.Type values as types themselves.

-Jeo


More information about the swift-evolution mailing list