Files
scriptc/tests/corpus/1954-generic-modules/main.ts
2026-07-22 18:08:04 -05:00

13 lines
478 B
TypeScript

// Generic values across modules: instantiations demanded from the importer,
// family statics shared program-wide, pinned generic-fn values imported.
import { Store, keep, local } from "./lib.ts";
const s = new Store<number>();
s.add(1).add(2);
const t = new Store<string>();
t.add("x");
console.log(s.items.join(","), t.items[0], Store.count, local.size);
const k: (x: number) => number = keep;
console.log(k(5), keep("direct"), s instanceof Store, local instanceof Store);