From 957bdae009ef401b538bb642c6e613cbf241367c Mon Sep 17 00:00:00 2001 From: ASDAlexander77 Date: Tue, 27 Oct 2026 16:59:34 +0000 Subject: [PATCH] -mm=own: Array's [Symbol.iterator] says @borrows("this") It returns this.values(), which borrows the array. Needs the compiler's generator over a `this` parameter borrowing it. Co-Authored-By: Claude Opus 5.5 --- src/generics/lib.generics.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/generics/lib.generics.ts b/src/generics/lib.generics.ts index f2d373e..9656081 100644 --- a/src/generics/lib.generics.ts +++ b/src/generics/lib.generics.ts @@ -391,6 +391,8 @@ namespace __Array { return this; } + // the iterator borrows the array, as values() does: under -mm=own the result may not outlive it + @borrows("this") function iterator(this: T[]) { return this.values(); }