• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Generics Problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Generics Problem
      • From: Michael de Haan  <email@hidden>
    • Re: Generics Problem
      • From: Quincey Morris <email@hidden>
References: 
 >Generics Problem (From: Michael de Haan  <email@hidden>)
 >Re: Generics Problem (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: Generics Problem
  • Next by Date: Re: Generics Problem
  • Previous by thread: Re: Generics Problem
  • Next by thread: Re: Generics Problem
  • Index(es):
    • Date
    • Thread