Skip to content

Commit

Permalink
Accept new baselines
Browse files Browse the repository at this point in the history
  • Loading branch information
ahejlsberg committed Jan 12, 2018
1 parent 13bf022 commit b6b936f
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/baselines/reference/strictFunctionTypes1.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ const x1 = f1(fo, fs); // (x: string) => void
const x2 = f2("abc", fo, fs); // "abc"
const x3 = f3("abc", fo, fx); // "abc" | "def"
const x4 = f4(fo, fs); // Func<string>

declare const never: never;

const x10 = f2(never, fo, fs); // string
const x11 = f3(never, fo, fx); // "def"

// Repro from #21112

declare function foo<T>(a: ReadonlyArray<T>): T;
let x = foo([]); // never


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


//// [strictFunctionTypes1.d.ts]
Expand All @@ -40,3 +53,8 @@ declare const x1: (x: string) => void;
declare const x2 = "abc";
declare const x3: string;
declare const x4: Func<string>;
declare const never: never;
declare const x10: string;
declare const x11: "def";
declare function foo<T>(a: ReadonlyArray<T>): T;
declare let x: never;
31 changes: 31 additions & 0 deletions tests/baselines/reference/strictFunctionTypes1.symbols
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,34 @@ const x4 = f4(fo, fs); // Func<string>
>fo : Symbol(fo, Decl(strictFunctionTypes1.ts, 6, 58))
>fs : Symbol(fs, Decl(strictFunctionTypes1.ts, 8, 37))

declare const never: never;
>never : Symbol(never, Decl(strictFunctionTypes1.ts, 17, 13))

const x10 = f2(never, fo, fs); // string
>x10 : Symbol(x10, Decl(strictFunctionTypes1.ts, 19, 5))
>f2 : Symbol(f2, Decl(strictFunctionTypes1.ts, 0, 79))
>never : Symbol(never, Decl(strictFunctionTypes1.ts, 17, 13))
>fo : Symbol(fo, Decl(strictFunctionTypes1.ts, 6, 58))
>fs : Symbol(fs, Decl(strictFunctionTypes1.ts, 8, 37))

const x11 = f3(never, fo, fx); // "def"
>x11 : Symbol(x11, Decl(strictFunctionTypes1.ts, 20, 5))
>f3 : Symbol(f3, Decl(strictFunctionTypes1.ts, 1, 74))
>never : Symbol(never, Decl(strictFunctionTypes1.ts, 17, 13))
>fo : Symbol(fo, Decl(strictFunctionTypes1.ts, 6, 58))
>fx : Symbol(fx, Decl(strictFunctionTypes1.ts, 9, 37))

// Repro from #21112

declare function foo<T>(a: ReadonlyArray<T>): T;
>foo : Symbol(foo, Decl(strictFunctionTypes1.ts, 20, 30))
>T : Symbol(T, Decl(strictFunctionTypes1.ts, 24, 21))
>a : Symbol(a, Decl(strictFunctionTypes1.ts, 24, 24))
>ReadonlyArray : Symbol(ReadonlyArray, Decl(lib.d.ts, --, --))
>T : Symbol(T, Decl(strictFunctionTypes1.ts, 24, 21))
>T : Symbol(T, Decl(strictFunctionTypes1.ts, 24, 21))

let x = foo([]); // never
>x : Symbol(x, Decl(strictFunctionTypes1.ts, 25, 3))
>foo : Symbol(foo, Decl(strictFunctionTypes1.ts, 20, 30))

35 changes: 35 additions & 0 deletions tests/baselines/reference/strictFunctionTypes1.types
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,38 @@ const x4 = f4(fo, fs); // Func<string>
>fo : (x: Object) => void
>fs : (x: string) => void

declare const never: never;
>never : never

const x10 = f2(never, fo, fs); // string
>x10 : string
>f2(never, fo, fs) : string
>f2 : <T>(obj: T, f1: (x: T) => void, f2: (x: T) => void) => T
>never : never
>fo : (x: Object) => void
>fs : (x: string) => void

const x11 = f3(never, fo, fx); // "def"
>x11 : "def"
>f3(never, fo, fx) : "def"
>f3 : <T>(obj: T, f1: (x: T) => void, f2: (f: (x: T) => void) => void) => T
>never : never
>fo : (x: Object) => void
>fx : (f: (x: "def") => void) => void

// Repro from #21112

declare function foo<T>(a: ReadonlyArray<T>): T;
>foo : <T>(a: ReadonlyArray<T>) => T
>T : T
>a : ReadonlyArray<T>
>ReadonlyArray : ReadonlyArray<T>
>T : T
>T : T

let x = foo([]); // never
>x : never
>foo([]) : never
>foo : <T>(a: ReadonlyArray<T>) => T
>[] : never[]

0 comments on commit b6b936f

Please sign in to comment.