mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-22 05:59:31 +08:00
- Preserve async factory results and mixed table layouts through inference and destructuring. - Support checked Map and Object.fromEntries construction with native weak collections. - Keep native weak-key lifetimes and engine-backed collection identities intact.
20 lines
820 B
TypeScript
20 lines
820 B
TypeScript
// Uses of a binding whose DECLARATION was blocked report the SC2004
|
|
// cascade — "inherits the blocker on its declaration" — instead of
|
|
// misattributing the reference itself. The root diagnostic stays on the
|
|
// declaration site; every use points back at it.
|
|
|
|
// A poisoned declaration (WeakRef values are fenced, and the type can't
|
|
// be salvaged): uses of 'w' cascade — reads and writes alike. (This
|
|
// battery used Symbol before symbol values grew a lowering.)
|
|
let w = new WeakRef<object>({});
|
|
console.log(typeof w);
|
|
w = new WeakRef<object>({});
|
|
|
|
// A signature-blocked function (WeakRef return type) used as a value: the
|
|
// deferred signature diagnostic flushes at the reference, and the value
|
|
// use itself cascades.
|
|
function makeWm(): WeakRef<object> {
|
|
return new WeakRef<object>({});
|
|
}
|
|
const f = makeWm;
|