Files
scriptc/tests/corpus/non-null-class-iteration.ts
T
Chris Tate 6aa48c111a Strengthen generic type and class boundaries
- Support concrete generic inheritance, forward references, and nullable substitutions.
- Bound recursive specialization demands while preserving independent concrete uses.
- Preserve class identity through checked assertions and contextual lowering.
2026-10-07 11:47:54 -05:00

5 lines
262 B
TypeScript

class Alpha { read(): string { return 'a'; } }
class Beta { read(): string { return 'b'; } }
const values: (Alpha | Beta | undefined)[] = [new Alpha(), new Beta()];
for (let i = 0; i < values.length; i++) { const value = values[i]; console.log(value!.read()); }