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

2015-08-20 Thread Antonio Nunes
On 19 Aug 2015, at 07:42, Quincey Morris quinceymor...@rivergatesoftware.com 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

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

2015-08-19 Thread Antonio Nunes
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

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

2015-08-19 Thread dangerwillrobinsondanger
Maybe file a bug to see if it's expected. But at first glance it seems clear to be ambiguous scope. it can't figure out that the first {} is part of the condition rather than the thing triggered by the condition. A do while knows more easily because the {} after do is what is conditionally

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

2015-08-19 Thread Quincey Morris
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”