From 1aaa8937bcc137458bebb39bd0261a15d2cfadef Mon Sep 17 00:00:00 2001 From: Neil Date: Thu, 17 Sep 2026 00:18:58 -0700 Subject: [PATCH] test(relay): type countingIterator as MapIterator and drop two suppressions The wrapper only ever receives a Map iterator, so declaring that removes the cast at both call sites; one irreducible cast stays on the object literal, which cannot satisfy MapIterator's full surface. Three suppressions become one. --- src/relay/relay-hot-path-operation-counts.test.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/relay/relay-hot-path-operation-counts.test.ts b/src/relay/relay-hot-path-operation-counts.test.ts index 1c927cc6592..77a3875bda1 100644 --- a/src/relay/relay-hot-path-operation-counts.test.ts +++ b/src/relay/relay-hot-path-operation-counts.test.ts @@ -12,7 +12,7 @@ class CountingMap extends Map { visits = 0 getCalls = 0 - private countingIterator(inner: IterableIterator): IterableIterator { + private countingIterator(inner: MapIterator): MapIterator { const bump = (): void => { this.visits++ } @@ -28,17 +28,15 @@ class CountingMap extends Map { [Symbol.iterator]() { return this } - } as IterableIterator + } as MapIterator } override [Symbol.iterator](): MapIterator<[K, V]> { - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: countingIterator wraps the real Map iterator and forwards every next() to it, so the result is that iterator with a counter attached. - return this.countingIterator(super[Symbol.iterator]()) as MapIterator<[K, V]> + return this.countingIterator(super[Symbol.iterator]()) } override values(): MapIterator { - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the same wrapper as [Symbol.iterator] above, over super.values(). - return this.countingIterator(super.values()) as MapIterator + return this.countingIterator(super.values()) } override get(key: K): V | undefined {