Files
scriptc/tests/diagnostics/generator-method-overrides.ts
Chris Tate 6aa732c089 Support static generator methods and loop bindings (#512)
Lower static and non-overridden instance generator methods through spawn wrappers. Bind sync and async generator loop values through declarations or assignment patterns, and preserve compound assignment expression values.
2026-09-27 23:33:40 -05:00

14 lines
276 B
TypeScript

class Base {
*values(): Generator<number, void, undefined> {
yield 1;
}
}
class Replaced extends Base {
*values(): Generator<number, void, undefined> {
yield 2;
}
}
const source: Base = new Replaced();
for (const value of source.values()) console.log(value);