[swift-users] Casting tuples to protocols always fails (and the compiler should know)

Sebastian Hagedorn sebastian at iosphere.de
Tue Oct 11 04:24:25 CDT 2016


Thanks for clarification.

I’ve created a bug report: https://bugs.swift.org/browse/SR-2915


> On 10 Oct 2016, at 19:57, Joe Groff <jgroff at apple.com> wrote:
> 
> 
>> On Oct 10, 2016, at 10:53 AM, Sebastian Hagedorn <sebastian at iosphere.de> wrote:
>> 
>> “Forever” is pretty long-term ;)
>> 
>> Since it is currently *not* possible for tuples to conform to protocols, isn’t it worth a warning (if my assumption that this would be easy to implement is correct), even if it may be obsolete in the future?
> 
> Yeah, even for non-tuples it may be worthwhile to offer a warning that there isn't a currently-visible protocol conformance for the type of the operand when it's a concrete type. You could easily enough silence the warning by writing 'as Any as? P' or something like that if you really want to.
> 
> -Joe



More information about the swift-users mailing list