Skip to content

Commit dadd9fd

Browse files
panagosg7facebook-github-bot
authored andcommitted
Type argument for ensureInstance in the structuredClone test
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] Differential Revision: D132764250
1 parent 83e2029 commit dadd9fd

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)