Re: Generics Problem
Re: Generics Problem
- Subject: Re: Generics Problem
- From: Jens Alfke <email@hidden>
- Date: Sat, 19 Sep 2015 13:46:36 -0700
> On Sep 19, 2015, at 11:26 AM, Quincey Morris <email@hidden> wrote:
>
> It looks like Swift is incapable of resolving the specialization of U when there is more than one generic type specifier:
Maybe it’s because the second type-spec T isn’t defined when the function is called. In both Michael’s and your examples, it doesn’t look to me as though the compiler has enough information at the call site to figure out what T should be. In Michael’s case I think T needs to be bound to the return type of self.moExistsWith, but working that out requires parsing the interior of the function being called (createMOforEntityName). That’s the sort of thing C++ can do because templates are really a type of macro expansion, but I’m not sure Swift’s compiler works that way.
—Jens
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden