> On Apr 14, 2016, at 9:00 AM, Joe Groff <jgr...@apple.com> wrote:
>
> This is a known bug. Converting arrays of value type to arrays of protocol
> type is not supported—only class covariance is supported with containers—but
> the compiler fails to catch some cases.
Thanks for the info!
I found that if I use AnyObject instead of Any, it does work correctly. Is that
because AnyObject isn’t a protocol? Or because conversion to AnyObject is a
‘magic’ case that uses Obj-C bridging?
My intuition is that [Any] will be more efficient than [AnyObject] for
primitive values like numbers, because the AnyObject conversion boxes the value
into a heap object, while converting to Any doesn’t. Or is that incorrect?
—Jens
_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users