Files
scriptc/tests/harness/__snapshots__/function-forms.ts.txt
Chris Tate 44cde1510e Split the SC2001 catch-all into named type-fence families
- New codes, minted in badType's classification order: SC2005 values whose type keeps a generic call signature, SC2006 index-signature shapes outside the supported set, SC2007 overloaded function types, SC2008 intersections with no resolved lowering, SC2009 supported container/function/record shapes over a component outside its slot — the SC2009 message names the offending component (Map/Set key-value domains, array/tuple elements, union arms, function rest/params/returns, record members) via describeComponentBlocker/describeRecordMemberBlocker in frontend/types.ts, which mirror mapType's own rules on the failure path only.
- Standard-library nominal types with no lowering at all (Date, ArrayBuffer, WeakMap, the iterator and constructor interfaces) now route to the existing SC2020 story instead of the supported-set recitation; stdlib provenance is checked after the container claims so Map/Set/Promise instantiation failures keep their component story.
- SC2001 keeps the honest remainder — bigint and symbol primitives, constructor objects, and library-derived or unresolved generic shapes — and its registry name now says so; across the diagnostics corpus its rendered sites drop from 57 to 5.
- Every new code flows through the diagnostics registry, the regenerated surface manifest, and coverage-report grouping; five new tests/diagnostics programs pin one rendered frame per code, and the ts7 order-parity baselines re-record to include them.
- Zero behavior change to accepted programs: the differential corpus (900 programs) is untouched and green, and the full suite passes.
2026-07-23 16:55:31 -05:00

22 lines
1.5 KiB
Plaintext

function-forms.ts:29:7 - error SC2009: values of type '(...args: number[]) => number' cannot be compiled: the function shape is supported, but its rest parameter 'args' has no compiled calling convention yet (a compiled signature is fixed-arity)
28 | // REST signatures are never spellable as exact-arity func types.
29 | const restRef = rest;
| ^~~~~~~
30 | // Union-typed parameter defaults compile now (corpus 1535); kept here as
hint: the outer shape is supported — the named component is the blocker; restate it inside the compilable set (number, string, boolean, arrays, Maps, Sets, RegExp, functions, classes, records, unions of those, and 'unknown')
function-forms.ts:29:17 - error SC1090: functions with rest parameters as values (call them directly) are not supported yet
28 | // REST signatures are never spellable as exact-arity func types.
29 | const restRef = rest;
| ^~~~
30 | // Union-typed parameter defaults compile now (corpus 1535); kept here as
function-forms.ts:37:3 - error SC1090: functions with optional or defaulted parameters as values, except where the target type spells the completed signature with required parameters (a '(x?: T) => R' function flows into a '(x: T | undefined) => R' slot, and a package/'any' slot takes any signature that can cross the island boundary; otherwise call the function directly) are not supported yet
36 | function outer(): number {
37 | function inner(n = 2): number {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
38 | return n;