Skip to content

lib.generics: explain why the array methods are free generic functions - #129

Merged
ASDAlexander77 merged 1 commit into
mainfrom
concat-comment-1130
Nov 30, 2026
Merged

ASDAlexander77 merged 1 commit into
mainfrom
concat-comment-1130

Conversation

@ASDAlexander77

Copy link
Copy Markdown
Owner

Comment-only change in src/generics/lib.generics.ts.

The comment above concat ("to prevent cycling initialization of T[][] ...") dates from 1d6962b (2024), when the array methods were a generic static class Array<T> and concat was the one exception, kept as a free function because its T[][] signature made building Array<T> build Array<Array<T>> without end. All the array methods are free generic functions in __Array now, so the comment is replaced with one that states the rule for all of them (concat and flat both mention T[][]).

Checked with the current compiler: nested concat (two and three levels, and Array<number[]>.concat) compiles and runs under gc and rc.

🤖 Generated with Claude Code

…s (concat comment)

The old comment dated from when the array methods were a generic static class Array<T>, with
concat the one exception; all of them are free functions in __Array now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ASDAlexander77
ASDAlexander77 merged commit 6350018 into main Nov 30, 2026
1 of 9 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