mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-28 06:53:42 +08:00
A package function declared to return its own type parameter, which also types one of its parameters (<T extends object>(obj: T) => T), hands back the argument or something standing in for it, and the package may track that object's identity. Effect's Equal.byReference returns a proxy it keeps in a WeakSet. The declaration-typed boundary cast such a result to the argument's type and built a separate native record, so Equal.equals(a, b) on two by-reference objects compared them by value and printed true where Node prints false. The result's type comes from the caller's argument, not from data the package declares, so the projection no longer casts these calls. The package re-export coverage test now expects three dynamic statements: since the boundary, readRows's declared number result keeps its type, so count - 1 in 7004-package-declared-type-reexports is native arithmetic.