mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-22 05:59:31 +08:00
- isSupportedIndexValue admits func/map/set: the overflow map's RC and trace machinery is already fully type-directed (scr_closure/scr_map adapters, the cycle fixpoint's map rule recursing on the value), and nested index-signature records rode the record kind all along - the C keyed-read miss trap can now describe Map/Set-typed slots (dynDesc), reachable only through that message — no dynCheck ever expects a container - SC2006's message and hint name the real value domain (functions, Maps, Sets, RegExps, Promises, ...) and the honest blockers left: symbol keys, dual signatures with unequal value types, and values with no representation at all - diagnostics fixtures pivot to still-fenced shapes (Uint8Array values, unequal duals, a Date-valued bag); corpus 2558/2559 pin the command-registry and container-table patterns — declared+overflow hybrids, enumeration, delete, registry-capturing cycles, container churn — byte-identical vs Node on both backends
24 lines
1.2 KiB
TypeScript
24 lines
1.2 KiB
TypeScript
// The fences around utility-type record shapes. Utility types over data
|
|
// shapes compile (Partial/Record/Pick/Omit/Readonly resolve to ordinary
|
|
// record shapes — differential corpus), and STRING and NUMBER index
|
|
// signatures over supported value types compile as hybrid shapes (declared
|
|
// fields + an overflow map; number keys canonicalize to their JS string
|
|
// spelling; function/Map/Set/nested-record values ride the same store —
|
|
// differential corpus); what stays rejected:
|
|
// - symbol-keyed index signatures (no lowering for symbol keys);
|
|
// - index-signature value types with no representation at all (Dates and
|
|
// other lib API objects);
|
|
// - utility types over LIB interfaces stay a type world, not data shapes.
|
|
// (Dot access/writes to index-signature keys compile now — the overflow
|
|
// path in dot spelling — and self-referential mapped types intern as
|
|
// named recursive shapes; differential corpus covers both.)
|
|
const bySymbol: { [s: symbol]: string } = {};
|
|
console.log(bySymbol);
|
|
|
|
const dateBag: { [k: string]: Date } = {};
|
|
const boot = dateBag["boot"];
|
|
console.log(boot);
|
|
|
|
const stamped: Readonly<Date> = new Date(0);
|
|
console.log(stamped.getTime());
|