mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-28 06:53:42 +08:00
- 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.
5 lines
262 B
TypeScript
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()); }
|