Swift: 'If' statement needing parentheses on closure return value property access?
Swift: 'If' statement needing parentheses on closure return value property access?
- Subject: Swift: 'If' statement needing parentheses on closure return value property access?
- From: Antonio Nunes <email@hidden>
- Date: Wed, 19 Aug 2015 07:04:19 +0100
In Swift 2.0 I can write this:
repeat {
…
} while reminder.exclusions.filter { $0.spansTime(t) }.count > 0
but I can’t write this:
if reminder.exclusions.filter { $0.spansTime(t) }.count > 0 {
…
}
which gives an error about consecutive statements on a line needing a “;”
If have to write this:
if (reminder.exclusions.filter { $0.spansTime(t) }.count > 0) {
…
}
Any ideas why?
-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