You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Invalid emit for declaring a class that references itself inside of a loop #31330
When downleveling the ES5 in this weird situation the TS compiler produces JS with either a syntax error or incorrect runtime semantics by placing a return statement where it does not belong. This error seems to happen when a class declared inside of a loop has a property that references itself. The error does not happen when the self-referencing property is removed. To test this, remove line 5 from the above example. This issue is reproducable for every kind of loop, not just for ... of loops, it also comes up when using while loops and for loops.
The bug does not happen when targeting ES2015 or above.
Activity
rrdelaney commentedon Jun 21, 2019
This is still reproducible on TS 3.5.1. Any updates?