Files
oxc/tasks/coverage/misc/pass/instantiation-before-for-in.cts
T
Boshen 3b36543095 fix(parser): preserve in-context after TypeScript type arguments (#28300)
Type arguments followed by `in` must preserve the surrounding grammar
context. Accept the binary operator in expressions while leaving it
available as the separator in `for-in` heads.

AI-assisted implementation.
2026-10-29 16:30:19 +08:00

6 lines
211 B
TypeScript

const factory = null as unknown as string & { <T>(): T };
const object = {};
// Keep the instantiation before the for-in delimiter in this non-strict CommonJS file.
for (var key = factory<number> in object) {}