mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-03 07:54:40 +08:00
With the overlay on, a lowering refusal no longer fails the build. The annotations the refusal depends on are dropped and the program is loaded and lowered again, so those declarations compile untyped, as they do without the overlay: - Each overlay annotation carries an id (`@scriptcShape #<pos>`). - shape-inference/fallback.ts blames the annotations of the declarations enclosing a refusal and of the declarations its expression names, following unannotated functions' returns. - Rounds that stop converging drop whole files' overlays, then the overlay for the build. SC6103 reports what was dropped. Also: - The tsc gate's project world is built over the files as written; it used to see the overlay's files, which failed the typecheck of three npm cases. - Arrays a builtin creates (match results, `new Array(n)`) are no longer typed by the overlay: they may have holes, and the library types them. - compile() accepts `shapeOverlay: true`. tests/harness/npm-shape-overlay.test.ts runs the whole npm suite with the overlay on (npm.test.ts's body moves to npm-suite.ts): every case builds and runs as in the default build, and a refused build that compiles with the overlay matches Node. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>