Skip to content

Commit a2234be

Browse files
committed
Make Equal fail typechecking with todo
failing typechecking makes the fact that the problems are correctly sovled more obvious and more satisfying, even if it means more errors when opening a new file
1 parent 02c82b6 commit a2234be

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

helpers.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
1-
type _Equal<X, Y> = (<T>() => T extends X ? 1 : 2) extends <T>() => T extends Y
1+
export type Equal<X, Y> = (<T>() => T extends X ? 1 : 2) extends <T>() => T extends Y
22
? 1
33
: 2
44
? true
55
: false;
66

7-
export type Equal<X, Y> = _Equal<X, TODO> extends true
8-
? true
9-
: _Equal<X, symbol> extends true
10-
? true
11-
: _Equal<X, Y>;
12-
137
export type Expect<T extends true> = T;
148

159
export type Tuple = [any, ...any[]];

0 commit comments

Comments
 (0)