• 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: Protocol extensions returning self
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Protocol extensions returning self


  • Subject: Re: Protocol extensions returning self
  • From: Quincey Morris <email@hidden>
  • Date: Thu, 04 Feb 2016 10:18:53 -0800
  • Feedback-id: 167118m:167118agrif8a:167118sbpr4VXYUm:SMTPCORP

On Feb 4, 2016, at 05:03 , Charles Jenkins <email@hidden> wrote:
>
> am I tilting at a windmill?

The problem is that the protocol in unspecific as to what kind of types it can be applied to, and your intentions don’t work if the type is a struct**. In fact, you only apply it to classes (Fluent.Sequence and Fluent.Group). So, you can fix the errors by saying that it’s a class-only protocol:

> 	protocol SKActionCollection: class {

and eliminating the ‘mutating’ keywords.


** Because structs constructed in a expression are literals and can’t be mutated even if they have mutating methods. That why ‘(a + a)++’ doesn’t compile, even if ‘a’ is a mutable variable.

_______________________________________________

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


References: 
 >Protocol extensions returning self (From: Charles Jenkins <email@hidden>)

  • Prev by Date: Different visualization of NSTableView row in Yosemite and El Capitan
  • Next by Date: Re: Weird Problem, is this an XCode Bug?
  • Previous by thread: Protocol extensions returning self
  • Next by thread: Re: Protocol extensions returning self
  • Index(es):
    • Date
    • Thread