Skip to content

Commit b6b936f

Browse files
committed
Accept new baselines
1 parent 13bf022 commit b6b936f

File tree

3 files changed

+84
-0
lines changed

3 files changed

+84
-0
lines changed

tests/baselines/reference/strictFunctionTypes1.js

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

1929

2030
//// [strictFunctionTypes1.js]
@@ -23,6 +33,9 @@ var x1 = f1(fo, fs); // (x: string) => void
2333
var x2 = f2("abc", fo, fs); // "abc"
2434
var x3 = f3("abc", fo, fx); // "abc" | "def"
2535
var x4 = f4(fo, fs); // Func<string>
36+
var x10 = f2(never, fo, fs); // string
37+
var x11 = f3(never, fo, fx); // "def"
38+
var x = foo([]); // never
2639

2740

2841
//// [strictFunctionTypes1.d.ts]
@@ -40,3 +53,8 @@ declare const x1: (x: string) => void;
4053
declare const x2 = "abc";
4154
declare const x3: string;
4255
declare const x4: Func<string>;
56+
declare const never: never;
57+
declare const x10: string;
58+
declare const x11: "def";
59+
declare function foo<T>(a: ReadonlyArray<T>): T;
60+
declare let x: never;

tests/baselines/reference/strictFunctionTypes1.symbols

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,34 @@ const x4 = f4(fo, fs); // Func<string>
9494
>fo : Symbol(fo, Decl(strictFunctionTypes1.ts, 6, 58))
9595
>fs : Symbol(fs, Decl(strictFunctionTypes1.ts, 8, 37))
9696

97+
declare const never: never;
98+
>never : Symbol(never, Decl(strictFunctionTypes1.ts, 17, 13))
99+
100+
const x10 = f2(never, fo, fs); // string
101+
>x10 : Symbol(x10, Decl(strictFunctionTypes1.ts, 19, 5))
102+
>f2 : Symbol(f2, Decl(strictFunctionTypes1.ts, 0, 79))
103+
>never : Symbol(never, Decl(strictFunctionTypes1.ts, 17, 13))
104+
>fo : Symbol(fo, Decl(strictFunctionTypes1.ts, 6, 58))
105+
>fs : Symbol(fs, Decl(strictFunctionTypes1.ts, 8, 37))
106+
107+
const x11 = f3(never, fo, fx); // "def"
108+
>x11 : Symbol(x11, Decl(strictFunctionTypes1.ts, 20, 5))
109+
>f3 : Symbol(f3, Decl(strictFunctionTypes1.ts, 1, 74))
110+
>never : Symbol(never, Decl(strictFunctionTypes1.ts, 17, 13))
111+
>fo : Symbol(fo, Decl(strictFunctionTypes1.ts, 6, 58))
112+
>fx : Symbol(fx, Decl(strictFunctionTypes1.ts, 9, 37))
113+
114+
// Repro from #21112
115+
116+
declare function foo<T>(a: ReadonlyArray<T>): T;
117+
>foo : Symbol(foo, Decl(strictFunctionTypes1.ts, 20, 30))
118+
>T : Symbol(T, Decl(strictFunctionTypes1.ts, 24, 21))
119+
>a : Symbol(a, Decl(strictFunctionTypes1.ts, 24, 24))
120+
>ReadonlyArray : Symbol(ReadonlyArray, Decl(lib.d.ts, --, --))
121+
>T : Symbol(T, Decl(strictFunctionTypes1.ts, 24, 21))
122+
>T : Symbol(T, Decl(strictFunctionTypes1.ts, 24, 21))
123+
124+
let x = foo([]); // never
125+
>x : Symbol(x, Decl(strictFunctionTypes1.ts, 25, 3))
126+
>foo : Symbol(foo, Decl(strictFunctionTypes1.ts, 20, 30))
127+

tests/baselines/reference/strictFunctionTypes1.types

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,38 @@ const x4 = f4(fo, fs); // Func<string>
100100
>fo : (x: Object) => void
101101
>fs : (x: string) => void
102102

103+
declare const never: never;
104+
>never : never
105+
106+
const x10 = f2(never, fo, fs); // string
107+
>x10 : string
108+
>f2(never, fo, fs) : string
109+
>f2 : <T>(obj: T, f1: (x: T) => void, f2: (x: T) => void) => T
110+
>never : never
111+
>fo : (x: Object) => void
112+
>fs : (x: string) => void
113+
114+
const x11 = f3(never, fo, fx); // "def"
115+
>x11 : "def"
116+
>f3(never, fo, fx) : "def"
117+
>f3 : <T>(obj: T, f1: (x: T) => void, f2: (f: (x: T) => void) => void) => T
118+
>never : never
119+
>fo : (x: Object) => void
120+
>fx : (f: (x: "def") => void) => void
121+
122+
// Repro from #21112
123+
124+
declare function foo<T>(a: ReadonlyArray<T>): T;
125+
>foo : <T>(a: ReadonlyArray<T>) => T
126+
>T : T
127+
>a : ReadonlyArray<T>
128+
>ReadonlyArray : ReadonlyArray<T>
129+
>T : T
130+
>T : T
131+
132+
let x = foo([]); // never
133+
>x : never
134+
>foo([]) : never
135+
>foo : <T>(a: ReadonlyArray<T>) => T
136+
>[] : never[]
137+

0 commit comments

Comments
 (0)