Skip to content

Commit

Permalink
test: fix syntax error in Equal type alias implementation (#2517)
Browse files Browse the repository at this point in the history
* Fix syntax error in Equal type alias implementation

* Fix : Adding a typing test
  • Loading branch information
sachin-nanayakkara committed Mar 23, 2023
1 parent 5eceb29 commit 8f8501c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions test/type/trigger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ import useSWR from 'swr'
type ExpectType = <T>(value: T) => void
const expectType: ExpectType = () => {}

type Equal<A, B> = (<T>() => T extends A ? 1 : 2) extends <T>() => T extends B
? 1
: 2
? true
: false
type Equal<A, B> = (<T>() => T extends A ? 1 : 2) extends (<T>() => T extends B ? 1 : 2) ? true : false;

// Test the Equal type
expectType<Equal<number, string>>(false) // should be false

export function useExtraParam() {
useSWRMutation('/api/user', key => {
Expand Down

0 comments on commit 8f8501c

Please sign in to comment.