From 374ab98d0da44ea3bd8bdc17ea3ac7341107b787 Mon Sep 17 00:00:00 2001 From: ASDAlexander77 Date: Mon, 30 Nov 2026 00:18:59 +0000 Subject: [PATCH] lib.generics: explain why the array methods are free generic functions (concat comment) The old comment dated from when the array methods were a generic static class Array, with concat the one exception; all of them are free functions in __Array now. Co-Authored-By: Claude Opus 5.5 --- src/generics/lib.generics.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/generics/lib.generics.ts b/src/generics/lib.generics.ts index 649c71d..1a4bb2e 100644 --- a/src/generics/lib.generics.ts +++ b/src/generics/lib.generics.ts @@ -150,7 +150,9 @@ namespace __Array { return this; } - // to prevent cycling initialization of T[][] as Array> which causes inf. cycle + // The array methods are free generic functions, built only when called. As methods of a + // generic class, a signature that mentions T[][] (concat, flat) would make building + // Array build Array, then Array, ... without end. @sharesElements function concat(this: T[], ...other: T[][]) { let count = this.length;