• 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: Swift: 'If' statement needing parentheses on closure return value property access?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Swift: 'If' statement needing parentheses on closure return value property access?


  • Subject: Re: Swift: 'If' statement needing parentheses on closure return value property access?
  • From: Antonio Nunes <email@hidden>
  • Date: Thu, 20 Aug 2015 14:05:14 +0100

> On 19 Aug 2015, at 07:42, Quincey Morris <email@hidden> wrote:
>
> Clearly it’s a “more ambiguous” context than the while case, which prevents the compiler from realizing that there is an alternative analysis that works. In that case, it’s the error message that’s at fault, since it doesn’t really tell you what’s wrong. In fact, this “consecutive statements” error almost never gives any help, but I guess the compiler is reluctant just to admit it has no clue.
>
>  On Aug 18, 2015, at 23:04 , Antonio Nunes <email@hidden> wrote:
>
>>                if (reminder.exclusions.filter { $0.spansTime(t) }.count > 0) {
>
> It might be clearer to write:
>
>> 	if reminder.exclusions.filter ({ $0.spansTime(t) }).count > 0 {
>

Thanks Quincy that’s what I went with. Now to write up a bug report explaining the issue and hoping for at least a better error message… :-)

Cheers,
-António
_______________________________________________

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: 
 >Swift: 'If' statement needing parentheses on closure return value property access? (From: Antonio Nunes <email@hidden>)
 >Re: Swift: 'If' statement needing parentheses on closure return value property access? (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: Crash help?
  • Next by Date: Re: Will iOS app accepted on App Store if 80% of UI is rendered on UIWebView and 20% being native OCR
  • Previous by thread: Re: Swift: 'If' statement needing parentheses on closure return value property access?
  • Next by thread: Cocoa Auto Layout Warning in Xcode console
  • Index(es):
    • Date
    • Thread