Skip to content

Commit 13bf022

Browse files
committed
Add regression tests
1 parent 6b882c7 commit 13bf022

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/cases/compiler/strictFunctionTypes1.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,13 @@ const x1 = f1(fo, fs); // (x: string) => void
1717
const x2 = f2("abc", fo, fs); // "abc"
1818
const x3 = f3("abc", fo, fx); // "abc" | "def"
1919
const x4 = f4(fo, fs); // Func<string>
20+
21+
declare const never: never;
22+
23+
const x10 = f2(never, fo, fs); // string
24+
const x11 = f3(never, fo, fx); // "def"
25+
26+
// Repro from #21112
27+
28+
declare function foo<T>(a: ReadonlyArray<T>): T;
29+
let x = foo([]); // never

0 commit comments

Comments
 (0)