[swift-evolution] Casting Bug Swift

Joe Groff jgroff at apple.com
Thu Feb 25 17:38:19 CST 2016


> On Feb 25, 2016, at 12:14 PM, Joe Groff via swift-evolution <swift-evolution at swift.org> wrote:
> 
>> 
>> On Feb 25, 2016, at 12:07 PM, Radek Pietruszewski <radexpl at gmail.com <mailto:radexpl at gmail.com>> wrote:
>> 
>> Hm. Obviously, you have far more insight into current implementation and performance difficulties, but purely from a programmer's perspective, going from [Foo] to AnyCollection<Foo> and from 'xs as? [Bar]' to 'xs.mapAsType(Bar.self)' seems like a step back.
> 
> True. This is all just ideas at this point. If we were serious about changing the currency type for collections, we'd probably want to change the type sugar to match.

An explicit `mapAsType` operation might also serve as the basis for a compiler-blessed protocol that allows for user-defined covariant container types.

-Joe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160225/80cd1342/attachment.html>


More information about the swift-evolution mailing list