mirror of
https://github.com/oxc-project/oxc.git
synced 2026-11-04 10:29:58 +00:00
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.
11 lines
332 B
TypeScript
11 lines
332 B
TypeScript
const factory = null as unknown as string & { <T>(): T };
|
|
const object = {};
|
|
type Box<T> = { value: T };
|
|
|
|
const direct = factory<number> in object;
|
|
const nested = factory<Box<number>> in object;
|
|
|
|
if (factory<string> in object) {}
|
|
for (; factory<number> in object; ) {}
|
|
for (let present = (factory<boolean> in object); present; ) {}
|