jashkenas/coffee-script — Issue #1850: inconsistency with pure statement and (nested) comprehensions
Author: michaelficarra
Created: 2011-11-10 07:25:37+00:00
State: open
Labels: bug

*__note__: resubmission of #1841 as the original submitter has become uncooperative; pinging previous issue contributors @satyr and @trevorburnham*

Caused by ad1bc1e0b858bf58fdd1df38f29915eec65d04de

Quoting @trevorburnham:

> Here's a more minimal test case:
>
> ->
> for a in b
> for b in c
> return b if condition
>
> 1.1.2 compiled this just fine; 1.1.3 thinks it's invalid. Of course, it's valid when the loop isn't a comprehension:
>
> ->
> for a in b
> for b in c
> return b if condition
> return
>
> So: Is this intentional, or are we being too strict? @jashkenas? @michaelficarra? If it's intentional, then why is
>
> ->
> for a in b
> return a if condition
>
> valid (compiling so as not to be a comprehension)?