Skip to content

WeakRef<T> is the compiler's built-in; the gc-only link class becomes GcWeakLink - #102

Merged
ASDAlexander77 merged 1 commit into
mainfrom
weakref-builtin
Nov 16, 2026
Merged

ASDAlexander77 merged 1 commit into
mainfrom
weakref-builtin

Conversation

@ASDAlexander77

Copy link
Copy Markdown
Owner

Companion to ASDAlexander77/TypeScriptCompiler#871: merge that PR first.

The compiler now has WeakRef<T> built in, under gc, own and none, and resolves it before any declaration of the name. The library's gc-only, collector-backed class stays, because WeakMap and WeakSet keep using it. It is renamed GcWeakLink so it no longer shadows the built-in (or is shadowed by it). The weakref_basic test comment is updated to match.

Tested with the compiler branch: every test passes under gc, own, none and rc. The only tests not run are those skipped by design. weakmap_weakset and weakref_basic pass under gc.

🤖 Generated with Claude Code

… GcWeakLink

The compiler now has WeakRef<T> itself (gc, own and none), resolved before any
declaration of the name. The library's collector-backed class stays for WeakMap and
WeakSet only, renamed so it no longer shadows (or is shadowed by) the built-in.
Needs the compiler's own-weakref change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ASDAlexander77
ASDAlexander77 merged commit 01cd842 into main Nov 16, 2026
8 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant