Skip to content

Commit 8f8501c

Browse files
test: fix syntax error in Equal type alias implementation (#2517)
* Fix syntax error in Equal type alias implementation * Fix : Adding a typing test
1 parent 5eceb29 commit 8f8501c

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

test/type/trigger.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@ import useSWR from 'swr'
33
type ExpectType = <T>(value: T) => void
44
const expectType: ExpectType = () => {}
55

6-
type Equal<A, B> = (<T>() => T extends A ? 1 : 2) extends <T>() => T extends B
7-
? 1
8-
: 2
9-
? true
10-
: false
6+
type Equal<A, B> = (<T>() => T extends A ? 1 : 2) extends (<T>() => T extends B ? 1 : 2) ? true : false;
7+
8+
// Test the Equal type
9+
expectType<Equal<number, string>>(false) // should be false
1110

1211
export function useExtraParam() {
1312
useSWRMutation('/api/user', key => {

0 commit comments

Comments
 (0)