🔎 Search Terms
for using of explicit resource management
🕗 Version & Regression Information
- This is the behavior in every version I tried
⏯ Playground Link
https://www.typescriptlang.org/play/?lib=lib.esnext.d.ts&ts=lib.esnext.d.ts#code/GYewTgBAFArgzgSwHYHMImBAvBJMA2+A3EQJQQBGYApgIYDWRQA
💻 Code
for (using of = null;;) break;
🙁 Actual behavior
Reports multiple errors as a result of failed parse, including:
Expression expected.
')' expected.
🙂 Expected behavior
It should parse successfully, much like the following:
for (var of = null;;) break;
for (let of = null;;) break;
for (const of = null;;) break;
Additional information about the issue
This was discussed in the Explicit Resource Management Repo here: tc39/proposal-explicit-resource-management#248
The test262 test for this can be found here: tc39/test262@fc3079a#diff-4ea0f4ef51852a9dec7036a93ec9576c387d2ad22eaf63992e36f81919c75ce3R14