mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 08:11:30 -06:00
Update tests
This commit is contained in:
parent
2010c4cda1
commit
197c635994
@ -1,11 +1,11 @@
|
||||
// @strict: true
|
||||
|
||||
declare function f<T>(x: T[]): T;
|
||||
declare function f1<T>(x: T[]): T;
|
||||
|
||||
let neverArray: never[] = [];
|
||||
|
||||
let a1 = f([]); // {}
|
||||
let a2 = f(neverArray); // never
|
||||
let a1 = f1([]); // never
|
||||
let a2 = f1(neverArray); // never
|
||||
|
||||
// Repro from #19576
|
||||
|
||||
@ -22,3 +22,9 @@ declare function compareNumbers(x: number, y: number): number;
|
||||
declare function mkList<T>(items: T[], comparator: Comparator<T>): LinkedList<T>;
|
||||
|
||||
const list: LinkedList<number> = mkList([], compareNumbers);
|
||||
|
||||
// Repro from #19858
|
||||
|
||||
declare function f2<a>(as1: a[], as2: a[], cmp: (a1: a, a2: a) => number): void;
|
||||
f2(Array.from([0]), [], (a1, a2) => a1 - a2);
|
||||
f2(Array.from([]), [0], (a1, a2) => a1 - a2);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user