The current PTC spec says that it's not a tail call to make a call that would otherwise be in tail position inside
try blocks
catch blocks
for-in loops
for-of loops
There is currently nothing in the stc proposal that forbids return continue in these places.
Further, the current spec allows
a || b()
to be in tail position, which we do not allow.
I think the dream of using a grammar parameter might be over. We either need to wind [ReturnExpr] all the way through StatementList and into TryStatement, or to just add Static Semantics sections to further clarify. However, using those sections to refine the current grammar is somewhat misleading. I guess there is already precedent for this kind of thing.
The current PTC spec says that it's not a tail call to make a call that would otherwise be in tail position inside
There is currently nothing in the stc proposal that forbids return continue in these places.
Further, the current spec allows
to be in tail position, which we do not allow.
I think the dream of using a grammar parameter might be over. We either need to wind [ReturnExpr] all the way through StatementList and into TryStatement, or to just add Static Semantics sections to further clarify. However, using those sections to refine the current grammar is somewhat misleading. I guess there is already precedent for this kind of thing.