Skip to content

Commit 5a14634

Browse files
authored
Type argument for ensureInstance in the structuredClone test (#60131)
Summary: `ensureInstance(clonedErrors[0], TypeError)` in `structuredClone-itest.js` leaves `T` underconstrained under Flow's new type-argument inference (`experimental.implicit_instantiation_walk`), which does not solve `T` from `Class<T>` against `TypeError`. The explicit `<TypeError>` is what the current inference picks, so the call checks the same in both. Changelog: [Internal] ___ landed-with-radar-review Differential Revision: D132764250 Pull Request resolved: #60131
1 parent 83e2029 commit 5a14634

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎packages/react-native/src/private/webapis/structuredClone/__tests__/structuredClone-itest.js‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,10 @@ describe('structuredClone', () => {
340340
const value = new AggregateError([innerError, {foo: 'bar'}], 'outer');
341341
const clone = structuredClone(value);
342342
const clonedErrors = Array.from(clone.errors);
343-
const clonedInnerError = ensureInstance(clonedErrors[0], TypeError);
343+
const clonedInnerError = ensureInstance<TypeError>(
344+
clonedErrors[0],
345+
TypeError,
346+
);
344347

345348
expect(clone).not.toBe(value);
346349
expect(clone).toBeInstanceOf(AggregateError);

0 commit comments

Comments
 (0)