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(); }