Skip to content

Commit 31c05c9

Browse files
committed
Fix expectExactType to be compatible with TypeScript 5.4
1 parent f5b07fe commit 31c05c9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/toolkit/src/tests/helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ type Equals<T, U> = IsAny<
1010
IsAny<U, never, [T] extends [U] ? ([U] extends [T] ? any : never) : never>
1111
>
1212
export function expectExactType<T>(t: T) {
13-
return <U extends Equals<T, U>>(u: U) => {}
13+
return <U extends T>(u: U & Equals<T, U>) => {}
1414
}
1515

1616
type EnsureUnknown<T extends any> = IsUnknown<T, any, never>

0 commit comments

Comments
 (0)