DanielXMoore / Civet

A TypeScript superset that favors more types and less typing
https://civet.dev
MIT License
1.36k stars 29 forks source link

`yield x; loop` has strange behavior #1162

Closed bbrk24 closed 5 months ago

bbrk24 commented 5 months ago

This is obviously a ParseError:

f := (x) ->
  yield x
  loop

However, this creates an array and pushes an infinite number of generator functions to it:

f := (x) ->
  yield x; loop

Shouldn't they both be errors?