From 04b1c26120e190765f1ecdf0bf1df83d212ddf3f Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Wed, 28 Sep 2016 10:58:20 -0700 Subject: [PATCH 1/5] Added test. --- tests/cases/compiler/mapOnTupleTypes01.ts | 45 +++++++++++++++++++++++ tests/cases/compiler/mapOnTupleTypes02.ts | 9 +++++ 2 files changed, 54 insertions(+) create mode 100644 tests/cases/compiler/mapOnTupleTypes01.ts create mode 100644 tests/cases/compiler/mapOnTupleTypes02.ts diff --git a/tests/cases/compiler/mapOnTupleTypes01.ts b/tests/cases/compiler/mapOnTupleTypes01.ts new file mode 100644 index 0000000000000..0a6ee2bda6a17 --- /dev/null +++ b/tests/cases/compiler/mapOnTupleTypes01.ts @@ -0,0 +1,45 @@ +// @declaration: true +// @noImplicitAny: true +// @strictNullChecks: true + +export let mapOnLooseArrayLiteral = [1, 2, 3, 4].map(n => n * n); + +// Length 1 + +let numTuple: [number] = [1]; +export let a = numTuple.map(x => x * x); + +// Length 2 + +let numNum: [number, number] = [ 100, 100]; +let strStr: [string, string] = ["hello", "hello"]; +let numStr: [number, string] = [ 100, "hello"]; + +export let b = numNum.map(n => n * n); +export let c = strStr.map(s => s.charCodeAt(0)); +export let d = numStr.map(x => x); + +// Length 3 + +let numNumNum: [number, number, number] = [1, 2, 3]; + +export let e = numNumNum.map(n => n * n); + +// Length 4 + +let numNumNumNum: [number, number, number, number] = [1, 2, 3, 4]; + +export let f = numNumNumNum.map(n => n * n); + +// Length 5 + +let numNumNumNumNum: [number, number, number, number, number] = [1, 2, 3, 4, 5]; + +export let g = numNumNumNumNum.map(n => n * n); + + +// Length 6 + +let numNumNumNumNumNum: [number, number, number, number, number, number] = [1, 2, 3, 4, 5, 6]; + +export let h = numNumNumNumNum.map(n => n * n); \ No newline at end of file diff --git a/tests/cases/compiler/mapOnTupleTypes02.ts b/tests/cases/compiler/mapOnTupleTypes02.ts new file mode 100644 index 0000000000000..e4c30fa0e8f2f --- /dev/null +++ b/tests/cases/compiler/mapOnTupleTypes02.ts @@ -0,0 +1,9 @@ +// @declaration: true +// @noImplicitAny: true +// @strictNullChecks: true + +export type Point = [number, number]; + +export function increment(point: Point) { + return point.map(d => d + 1); +} \ No newline at end of file From d1416de4c7f769350e2b2154ffa1b587234766ee Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 29 Sep 2016 00:40:50 -0700 Subject: [PATCH 2/5] Accepted baselines. --- .../baselines/reference/mapOnTupleTypes01.js | 81 ++++++++ .../reference/mapOnTupleTypes01.symbols | 119 +++++++++++ .../reference/mapOnTupleTypes01.types | 184 ++++++++++++++++++ .../baselines/reference/mapOnTupleTypes02.js | 19 ++ .../reference/mapOnTupleTypes02.symbols | 17 ++ .../reference/mapOnTupleTypes02.types | 21 ++ 6 files changed, 441 insertions(+) create mode 100644 tests/baselines/reference/mapOnTupleTypes01.js create mode 100644 tests/baselines/reference/mapOnTupleTypes01.symbols create mode 100644 tests/baselines/reference/mapOnTupleTypes01.types create mode 100644 tests/baselines/reference/mapOnTupleTypes02.js create mode 100644 tests/baselines/reference/mapOnTupleTypes02.symbols create mode 100644 tests/baselines/reference/mapOnTupleTypes02.types diff --git a/tests/baselines/reference/mapOnTupleTypes01.js b/tests/baselines/reference/mapOnTupleTypes01.js new file mode 100644 index 0000000000000..6c51cf3e6a38e --- /dev/null +++ b/tests/baselines/reference/mapOnTupleTypes01.js @@ -0,0 +1,81 @@ +//// [mapOnTupleTypes01.ts] + +export let mapOnLooseArrayLiteral = [1, 2, 3, 4].map(n => n * n); + +// Length 1 + +let numTuple: [number] = [1]; +export let a = numTuple.map(x => x * x); + +// Length 2 + +let numNum: [number, number] = [ 100, 100]; +let strStr: [string, string] = ["hello", "hello"]; +let numStr: [number, string] = [ 100, "hello"]; + +export let b = numNum.map(n => n * n); +export let c = strStr.map(s => s.charCodeAt(0)); +export let d = numStr.map(x => x); + +// Length 3 + +let numNumNum: [number, number, number] = [1, 2, 3]; + +export let e = numNumNum.map(n => n * n); + +// Length 4 + +let numNumNumNum: [number, number, number, number] = [1, 2, 3, 4]; + +export let f = numNumNumNum.map(n => n * n); + +// Length 5 + +let numNumNumNumNum: [number, number, number, number, number] = [1, 2, 3, 4, 5]; + +export let g = numNumNumNumNum.map(n => n * n); + + +// Length 6 + +let numNumNumNumNumNum: [number, number, number, number, number, number] = [1, 2, 3, 4, 5, 6]; + +export let h = numNumNumNumNum.map(n => n * n); + +//// [mapOnTupleTypes01.js] +"use strict"; +exports.mapOnLooseArrayLiteral = [1, 2, 3, 4].map(function (n) { return n * n; }); +// Length 1 +var numTuple = [1]; +exports.a = numTuple.map(function (x) { return x * x; }); +// Length 2 +var numNum = [100, 100]; +var strStr = ["hello", "hello"]; +var numStr = [100, "hello"]; +exports.b = numNum.map(function (n) { return n * n; }); +exports.c = strStr.map(function (s) { return s.charCodeAt(0); }); +exports.d = numStr.map(function (x) { return x; }); +// Length 3 +var numNumNum = [1, 2, 3]; +exports.e = numNumNum.map(function (n) { return n * n; }); +// Length 4 +var numNumNumNum = [1, 2, 3, 4]; +exports.f = numNumNumNum.map(function (n) { return n * n; }); +// Length 5 +var numNumNumNumNum = [1, 2, 3, 4, 5]; +exports.g = numNumNumNumNum.map(function (n) { return n * n; }); +// Length 6 +var numNumNumNumNumNum = [1, 2, 3, 4, 5, 6]; +exports.h = numNumNumNumNum.map(function (n) { return n * n; }); + + +//// [mapOnTupleTypes01.d.ts] +export declare let mapOnLooseArrayLiteral: number[]; +export declare let a: number[]; +export declare let b: number[]; +export declare let c: number[]; +export declare let d: (string | number)[]; +export declare let e: number[]; +export declare let f: number[]; +export declare let g: number[]; +export declare let h: number[]; diff --git a/tests/baselines/reference/mapOnTupleTypes01.symbols b/tests/baselines/reference/mapOnTupleTypes01.symbols new file mode 100644 index 0000000000000..1c735fc06cfb5 --- /dev/null +++ b/tests/baselines/reference/mapOnTupleTypes01.symbols @@ -0,0 +1,119 @@ +=== tests/cases/compiler/mapOnTupleTypes01.ts === + +export let mapOnLooseArrayLiteral = [1, 2, 3, 4].map(n => n * n); +>mapOnLooseArrayLiteral : Symbol(mapOnLooseArrayLiteral, Decl(mapOnTupleTypes01.ts, 1, 10)) +>[1, 2, 3, 4].map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>n : Symbol(n, Decl(mapOnTupleTypes01.ts, 1, 53)) +>n : Symbol(n, Decl(mapOnTupleTypes01.ts, 1, 53)) +>n : Symbol(n, Decl(mapOnTupleTypes01.ts, 1, 53)) + +// Length 1 + +let numTuple: [number] = [1]; +>numTuple : Symbol(numTuple, Decl(mapOnTupleTypes01.ts, 5, 3)) + +export let a = numTuple.map(x => x * x); +>a : Symbol(a, Decl(mapOnTupleTypes01.ts, 6, 10)) +>numTuple.map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>numTuple : Symbol(numTuple, Decl(mapOnTupleTypes01.ts, 5, 3)) +>map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>x : Symbol(x, Decl(mapOnTupleTypes01.ts, 6, 28)) +>x : Symbol(x, Decl(mapOnTupleTypes01.ts, 6, 28)) +>x : Symbol(x, Decl(mapOnTupleTypes01.ts, 6, 28)) + +// Length 2 + +let numNum: [number, number] = [ 100, 100]; +>numNum : Symbol(numNum, Decl(mapOnTupleTypes01.ts, 10, 3)) + +let strStr: [string, string] = ["hello", "hello"]; +>strStr : Symbol(strStr, Decl(mapOnTupleTypes01.ts, 11, 3)) + +let numStr: [number, string] = [ 100, "hello"]; +>numStr : Symbol(numStr, Decl(mapOnTupleTypes01.ts, 12, 3)) + +export let b = numNum.map(n => n * n); +>b : Symbol(b, Decl(mapOnTupleTypes01.ts, 14, 10)) +>numNum.map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>numNum : Symbol(numNum, Decl(mapOnTupleTypes01.ts, 10, 3)) +>map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>n : Symbol(n, Decl(mapOnTupleTypes01.ts, 14, 26)) +>n : Symbol(n, Decl(mapOnTupleTypes01.ts, 14, 26)) +>n : Symbol(n, Decl(mapOnTupleTypes01.ts, 14, 26)) + +export let c = strStr.map(s => s.charCodeAt(0)); +>c : Symbol(c, Decl(mapOnTupleTypes01.ts, 15, 10)) +>strStr.map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>strStr : Symbol(strStr, Decl(mapOnTupleTypes01.ts, 11, 3)) +>map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>s : Symbol(s, Decl(mapOnTupleTypes01.ts, 15, 26)) +>s.charCodeAt : Symbol(String.charCodeAt, Decl(lib.d.ts, --, --)) +>s : Symbol(s, Decl(mapOnTupleTypes01.ts, 15, 26)) +>charCodeAt : Symbol(String.charCodeAt, Decl(lib.d.ts, --, --)) + +export let d = numStr.map(x => x); +>d : Symbol(d, Decl(mapOnTupleTypes01.ts, 16, 10)) +>numStr.map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>numStr : Symbol(numStr, Decl(mapOnTupleTypes01.ts, 12, 3)) +>map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>x : Symbol(x, Decl(mapOnTupleTypes01.ts, 16, 26)) +>x : Symbol(x, Decl(mapOnTupleTypes01.ts, 16, 26)) + +// Length 3 + +let numNumNum: [number, number, number] = [1, 2, 3]; +>numNumNum : Symbol(numNumNum, Decl(mapOnTupleTypes01.ts, 20, 3)) + +export let e = numNumNum.map(n => n * n); +>e : Symbol(e, Decl(mapOnTupleTypes01.ts, 22, 10)) +>numNumNum.map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>numNumNum : Symbol(numNumNum, Decl(mapOnTupleTypes01.ts, 20, 3)) +>map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>n : Symbol(n, Decl(mapOnTupleTypes01.ts, 22, 29)) +>n : Symbol(n, Decl(mapOnTupleTypes01.ts, 22, 29)) +>n : Symbol(n, Decl(mapOnTupleTypes01.ts, 22, 29)) + +// Length 4 + +let numNumNumNum: [number, number, number, number] = [1, 2, 3, 4]; +>numNumNumNum : Symbol(numNumNumNum, Decl(mapOnTupleTypes01.ts, 26, 3)) + +export let f = numNumNumNum.map(n => n * n); +>f : Symbol(f, Decl(mapOnTupleTypes01.ts, 28, 10)) +>numNumNumNum.map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>numNumNumNum : Symbol(numNumNumNum, Decl(mapOnTupleTypes01.ts, 26, 3)) +>map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>n : Symbol(n, Decl(mapOnTupleTypes01.ts, 28, 32)) +>n : Symbol(n, Decl(mapOnTupleTypes01.ts, 28, 32)) +>n : Symbol(n, Decl(mapOnTupleTypes01.ts, 28, 32)) + +// Length 5 + +let numNumNumNumNum: [number, number, number, number, number] = [1, 2, 3, 4, 5]; +>numNumNumNumNum : Symbol(numNumNumNumNum, Decl(mapOnTupleTypes01.ts, 32, 3)) + +export let g = numNumNumNumNum.map(n => n * n); +>g : Symbol(g, Decl(mapOnTupleTypes01.ts, 34, 10)) +>numNumNumNumNum.map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>numNumNumNumNum : Symbol(numNumNumNumNum, Decl(mapOnTupleTypes01.ts, 32, 3)) +>map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>n : Symbol(n, Decl(mapOnTupleTypes01.ts, 34, 35)) +>n : Symbol(n, Decl(mapOnTupleTypes01.ts, 34, 35)) +>n : Symbol(n, Decl(mapOnTupleTypes01.ts, 34, 35)) + + +// Length 6 + +let numNumNumNumNumNum: [number, number, number, number, number, number] = [1, 2, 3, 4, 5, 6]; +>numNumNumNumNumNum : Symbol(numNumNumNumNumNum, Decl(mapOnTupleTypes01.ts, 39, 3)) + +export let h = numNumNumNumNum.map(n => n * n); +>h : Symbol(h, Decl(mapOnTupleTypes01.ts, 41, 10)) +>numNumNumNumNum.map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>numNumNumNumNum : Symbol(numNumNumNumNum, Decl(mapOnTupleTypes01.ts, 32, 3)) +>map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>n : Symbol(n, Decl(mapOnTupleTypes01.ts, 41, 35)) +>n : Symbol(n, Decl(mapOnTupleTypes01.ts, 41, 35)) +>n : Symbol(n, Decl(mapOnTupleTypes01.ts, 41, 35)) + diff --git a/tests/baselines/reference/mapOnTupleTypes01.types b/tests/baselines/reference/mapOnTupleTypes01.types new file mode 100644 index 0000000000000..b97b9570fa17e --- /dev/null +++ b/tests/baselines/reference/mapOnTupleTypes01.types @@ -0,0 +1,184 @@ +=== tests/cases/compiler/mapOnTupleTypes01.ts === + +export let mapOnLooseArrayLiteral = [1, 2, 3, 4].map(n => n * n); +>mapOnLooseArrayLiteral : number[] +>[1, 2, 3, 4].map(n => n * n) : number[] +>[1, 2, 3, 4].map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] +>[1, 2, 3, 4] : number[] +>1 : 1 +>2 : 2 +>3 : 3 +>4 : 4 +>map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] +>n => n * n : (n: number) => number +>n : number +>n * n : number +>n : number +>n : number + +// Length 1 + +let numTuple: [number] = [1]; +>numTuple : [number] +>[1] : [number] +>1 : 1 + +export let a = numTuple.map(x => x * x); +>a : number[] +>numTuple.map(x => x * x) : number[] +>numTuple.map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] +>numTuple : [number] +>map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] +>x => x * x : (x: number) => number +>x : number +>x * x : number +>x : number +>x : number + +// Length 2 + +let numNum: [number, number] = [ 100, 100]; +>numNum : [number, number] +>[ 100, 100] : [number, number] +>100 : 100 +>100 : 100 + +let strStr: [string, string] = ["hello", "hello"]; +>strStr : [string, string] +>["hello", "hello"] : [string, string] +>"hello" : "hello" +>"hello" : "hello" + +let numStr: [number, string] = [ 100, "hello"]; +>numStr : [number, string] +>[ 100, "hello"] : [number, string] +>100 : 100 +>"hello" : "hello" + +export let b = numNum.map(n => n * n); +>b : number[] +>numNum.map(n => n * n) : number[] +>numNum.map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] +>numNum : [number, number] +>map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] +>n => n * n : (n: number) => number +>n : number +>n * n : number +>n : number +>n : number + +export let c = strStr.map(s => s.charCodeAt(0)); +>c : number[] +>strStr.map(s => s.charCodeAt(0)) : number[] +>strStr.map : (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[] +>strStr : [string, string] +>map : (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[] +>s => s.charCodeAt(0) : (s: string) => number +>s : string +>s.charCodeAt(0) : number +>s.charCodeAt : (index: number) => number +>s : string +>charCodeAt : (index: number) => number +>0 : 0 + +export let d = numStr.map(x => x); +>d : (string | number)[] +>numStr.map(x => x) : (string | number)[] +>numStr.map : (callbackfn: (value: string | number, index: number, array: (string | number)[]) => U, thisArg?: any) => U[] +>numStr : [number, string] +>map : (callbackfn: (value: string | number, index: number, array: (string | number)[]) => U, thisArg?: any) => U[] +>x => x : (x: string | number) => string | number +>x : string | number +>x : string | number + +// Length 3 + +let numNumNum: [number, number, number] = [1, 2, 3]; +>numNumNum : [number, number, number] +>[1, 2, 3] : [number, number, number] +>1 : 1 +>2 : 2 +>3 : 3 + +export let e = numNumNum.map(n => n * n); +>e : number[] +>numNumNum.map(n => n * n) : number[] +>numNumNum.map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] +>numNumNum : [number, number, number] +>map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] +>n => n * n : (n: number) => number +>n : number +>n * n : number +>n : number +>n : number + +// Length 4 + +let numNumNumNum: [number, number, number, number] = [1, 2, 3, 4]; +>numNumNumNum : [number, number, number, number] +>[1, 2, 3, 4] : [number, number, number, number] +>1 : 1 +>2 : 2 +>3 : 3 +>4 : 4 + +export let f = numNumNumNum.map(n => n * n); +>f : number[] +>numNumNumNum.map(n => n * n) : number[] +>numNumNumNum.map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] +>numNumNumNum : [number, number, number, number] +>map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] +>n => n * n : (n: number) => number +>n : number +>n * n : number +>n : number +>n : number + +// Length 5 + +let numNumNumNumNum: [number, number, number, number, number] = [1, 2, 3, 4, 5]; +>numNumNumNumNum : [number, number, number, number, number] +>[1, 2, 3, 4, 5] : [number, number, number, number, number] +>1 : 1 +>2 : 2 +>3 : 3 +>4 : 4 +>5 : 5 + +export let g = numNumNumNumNum.map(n => n * n); +>g : number[] +>numNumNumNumNum.map(n => n * n) : number[] +>numNumNumNumNum.map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] +>numNumNumNumNum : [number, number, number, number, number] +>map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] +>n => n * n : (n: number) => number +>n : number +>n * n : number +>n : number +>n : number + + +// Length 6 + +let numNumNumNumNumNum: [number, number, number, number, number, number] = [1, 2, 3, 4, 5, 6]; +>numNumNumNumNumNum : [number, number, number, number, number, number] +>[1, 2, 3, 4, 5, 6] : [number, number, number, number, number, number] +>1 : 1 +>2 : 2 +>3 : 3 +>4 : 4 +>5 : 5 +>6 : 6 + +export let h = numNumNumNumNum.map(n => n * n); +>h : number[] +>numNumNumNumNum.map(n => n * n) : number[] +>numNumNumNumNum.map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] +>numNumNumNumNum : [number, number, number, number, number] +>map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] +>n => n * n : (n: number) => number +>n : number +>n * n : number +>n : number +>n : number + diff --git a/tests/baselines/reference/mapOnTupleTypes02.js b/tests/baselines/reference/mapOnTupleTypes02.js new file mode 100644 index 0000000000000..0f5f59f32858a --- /dev/null +++ b/tests/baselines/reference/mapOnTupleTypes02.js @@ -0,0 +1,19 @@ +//// [mapOnTupleTypes02.ts] + +export type Point = [number, number]; + +export function increment(point: Point) { + return point.map(d => d + 1); +} + +//// [mapOnTupleTypes02.js] +"use strict"; +function increment(point) { + return point.map(function (d) { return d + 1; }); +} +exports.increment = increment; + + +//// [mapOnTupleTypes02.d.ts] +export declare type Point = [number, number]; +export declare function increment(point: Point): number[]; diff --git a/tests/baselines/reference/mapOnTupleTypes02.symbols b/tests/baselines/reference/mapOnTupleTypes02.symbols new file mode 100644 index 0000000000000..e0f1ca79f6134 --- /dev/null +++ b/tests/baselines/reference/mapOnTupleTypes02.symbols @@ -0,0 +1,17 @@ +=== tests/cases/compiler/mapOnTupleTypes02.ts === + +export type Point = [number, number]; +>Point : Symbol(Point, Decl(mapOnTupleTypes02.ts, 0, 0)) + +export function increment(point: Point) { +>increment : Symbol(increment, Decl(mapOnTupleTypes02.ts, 1, 37)) +>point : Symbol(point, Decl(mapOnTupleTypes02.ts, 3, 26)) +>Point : Symbol(Point, Decl(mapOnTupleTypes02.ts, 0, 0)) + + return point.map(d => d + 1); +>point.map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>point : Symbol(point, Decl(mapOnTupleTypes02.ts, 3, 26)) +>map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>d : Symbol(d, Decl(mapOnTupleTypes02.ts, 4, 19)) +>d : Symbol(d, Decl(mapOnTupleTypes02.ts, 4, 19)) +} diff --git a/tests/baselines/reference/mapOnTupleTypes02.types b/tests/baselines/reference/mapOnTupleTypes02.types new file mode 100644 index 0000000000000..bb261f3093add --- /dev/null +++ b/tests/baselines/reference/mapOnTupleTypes02.types @@ -0,0 +1,21 @@ +=== tests/cases/compiler/mapOnTupleTypes02.ts === + +export type Point = [number, number]; +>Point : [number, number] + +export function increment(point: Point) { +>increment : (point: [number, number]) => number[] +>point : [number, number] +>Point : [number, number] + + return point.map(d => d + 1); +>point.map(d => d + 1) : number[] +>point.map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] +>point : [number, number] +>map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] +>d => d + 1 : (d: number) => number +>d : number +>d + 1 : number +>d : number +>1 : 1 +} From 7f3db5cf187c602a84dfb608f9ead0a72e554f65 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 29 Sep 2016 00:41:06 -0700 Subject: [PATCH 3/5] Added overloads for 'map' on tuple types. --- src/lib/es5.d.ts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/lib/es5.d.ts b/src/lib/es5.d.ts index ce719668acf4e..ccff01a87228e 100644 --- a/src/lib/es5.d.ts +++ b/src/lib/es5.d.ts @@ -1200,6 +1200,30 @@ interface Array { * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. */ forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void; + /** + * Calls a defined callback function on each element of an array, and returns an array that contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + map(this: [T, T, T, T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U, U, U, U]; + /** + * Calls a defined callback function on each element of an array, and returns an array that contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + map(this: [T, T, T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U, U, U]; + /** + * Calls a defined callback function on each element of an array, and returns an array that contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + map(this: [T, T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U, U]; + /** + * Calls a defined callback function on each element of an array, and returns an array that contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + map(this: [T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U]; /** * Calls a defined callback function on each element of an array, and returns an array that contains the results. * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. From d0607a9db7716ece6c84f8f38c0c65646fb466a2 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 29 Sep 2016 10:39:31 -0700 Subject: [PATCH 4/5] Accepted baselines. --- .../anyInferenceAnonymousFunctions.symbols | 8 +-- .../anyInferenceAnonymousFunctions.types | 8 +-- .../reference/arrayConcatMap.symbols | 4 +- .../baselines/reference/arrayConcatMap.types | 4 +- .../reference/bestChoiceType.symbols | 12 ++-- .../baselines/reference/bestChoiceType.types | 12 ++-- .../reference/commentInMethodCall.symbols | 4 +- .../reference/commentInMethodCall.types | 4 +- .../contextualSignatureInstantiation3.symbols | 12 ++-- .../contextualSignatureInstantiation3.types | 12 ++-- .../reference/contextuallyTypedIife.symbols | 4 +- .../reference/contextuallyTypedIife.types | 4 +- ...controlFlowDestructuringParameters.symbols | 4 +- .../controlFlowDestructuringParameters.types | 4 +- tests/baselines/reference/enumIndexer.symbols | 4 +- tests/baselines/reference/enumIndexer.types | 4 +- .../baselines/reference/genericArray1.symbols | 4 +- tests/baselines/reference/genericArray1.types | 4 +- .../reference/genericInference1.symbols | 4 +- .../reference/genericInference1.types | 4 +- .../genericMethodOverspecialization.symbols | 8 +-- .../genericMethodOverspecialization.types | 8 +-- .../implementArrayInterface.errors.txt | 47 ++++++++++++++ .../reference/inferenceLimit.symbols | 4 +- .../baselines/reference/inferenceLimit.types | 4 +- ...inferentialTypingWithFunctionType2.symbols | 4 +- .../inferentialTypingWithFunctionType2.types | 4 +- .../baselines/reference/mapOnTupleTypes01.js | 14 ++-- .../reference/mapOnTupleTypes01.symbols | 36 +++++------ .../reference/mapOnTupleTypes01.types | 64 +++++++++---------- .../baselines/reference/mapOnTupleTypes02.js | 2 +- .../reference/mapOnTupleTypes02.symbols | 4 +- .../reference/mapOnTupleTypes02.types | 8 +-- tests/baselines/reference/nestedSelf.symbols | 4 +- tests/baselines/reference/nestedSelf.types | 4 +- ...arameterReferencedInObjectLiteral1.symbols | 8 +-- ...nParameterReferencedInObjectLiteral1.types | 8 +-- ...alizationsShouldNotAffectEachOther.symbols | 8 +-- ...cializationsShouldNotAffectEachOther.types | 8 +-- ...ReferencedTypeAliasToTypeLiteral01.symbols | 4 +- ...lyReferencedTypeAliasToTypeLiteral01.types | 4 +- ...ReferencedTypeAliasToTypeLiteral02.symbols | 4 +- ...lyReferencedTypeAliasToTypeLiteral02.types | 4 +- 43 files changed, 215 insertions(+), 168 deletions(-) create mode 100644 tests/baselines/reference/implementArrayInterface.errors.txt diff --git a/tests/baselines/reference/anyInferenceAnonymousFunctions.symbols b/tests/baselines/reference/anyInferenceAnonymousFunctions.symbols index c1b5df88fb0b2..ff576a3642388 100644 --- a/tests/baselines/reference/anyInferenceAnonymousFunctions.symbols +++ b/tests/baselines/reference/anyInferenceAnonymousFunctions.symbols @@ -35,16 +35,16 @@ paired.reduce((b3, b4) => b3.concat({}), []); >b3 : Symbol(b3, Decl(anyInferenceAnonymousFunctions.ts, 13, 15)) paired.map((c1) => c1.count); ->paired.map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>paired.map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >paired : Symbol(paired, Decl(anyInferenceAnonymousFunctions.ts, 0, 3)) ->map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >c1 : Symbol(c1, Decl(anyInferenceAnonymousFunctions.ts, 15, 12)) >c1 : Symbol(c1, Decl(anyInferenceAnonymousFunctions.ts, 15, 12)) paired.map(function (c2) { return c2.count; }); ->paired.map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>paired.map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >paired : Symbol(paired, Decl(anyInferenceAnonymousFunctions.ts, 0, 3)) ->map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >c2 : Symbol(c2, Decl(anyInferenceAnonymousFunctions.ts, 16, 21)) >c2 : Symbol(c2, Decl(anyInferenceAnonymousFunctions.ts, 16, 21)) diff --git a/tests/baselines/reference/anyInferenceAnonymousFunctions.types b/tests/baselines/reference/anyInferenceAnonymousFunctions.types index 8dc7fdcb90f1d..1f3bb78f958e8 100644 --- a/tests/baselines/reference/anyInferenceAnonymousFunctions.types +++ b/tests/baselines/reference/anyInferenceAnonymousFunctions.types @@ -57,9 +57,9 @@ paired.reduce((b3, b4) => b3.concat({}), []); paired.map((c1) => c1.count); >paired.map((c1) => c1.count) : any[] ->paired.map : (callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any) => U[] +>paired.map : { (this: [any, any, any, any, any], callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [any, any, any, any], callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): [U, U, U, U]; (this: [any, any, any], callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): [U, U, U]; (this: [any, any], callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): U[]; } >paired : any[] ->map : (callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any) => U[] +>map : { (this: [any, any, any, any, any], callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [any, any, any, any], callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): [U, U, U, U]; (this: [any, any, any], callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): [U, U, U]; (this: [any, any], callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): U[]; } >(c1) => c1.count : (c1: any) => any >c1 : any >c1.count : any @@ -68,9 +68,9 @@ paired.map((c1) => c1.count); paired.map(function (c2) { return c2.count; }); >paired.map(function (c2) { return c2.count; }) : any[] ->paired.map : (callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any) => U[] +>paired.map : { (this: [any, any, any, any, any], callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [any, any, any, any], callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): [U, U, U, U]; (this: [any, any, any], callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): [U, U, U]; (this: [any, any], callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): U[]; } >paired : any[] ->map : (callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any) => U[] +>map : { (this: [any, any, any, any, any], callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [any, any, any, any], callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): [U, U, U, U]; (this: [any, any, any], callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): [U, U, U]; (this: [any, any], callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): U[]; } >function (c2) { return c2.count; } : (c2: any) => any >c2 : any >c2.count : any diff --git a/tests/baselines/reference/arrayConcatMap.symbols b/tests/baselines/reference/arrayConcatMap.symbols index 5ef9d81172348..c3df6bed5336c 100644 --- a/tests/baselines/reference/arrayConcatMap.symbols +++ b/tests/baselines/reference/arrayConcatMap.symbols @@ -1,14 +1,14 @@ === tests/cases/compiler/arrayConcatMap.ts === var x = [].concat([{ a: 1 }], [{ a: 2 }]) >x : Symbol(x, Decl(arrayConcatMap.ts, 0, 3)) ->[].concat([{ a: 1 }], [{ a: 2 }]) .map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>[].concat([{ a: 1 }], [{ a: 2 }]) .map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >[].concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >a : Symbol(a, Decl(arrayConcatMap.ts, 0, 20)) >a : Symbol(a, Decl(arrayConcatMap.ts, 0, 32)) .map(b => b.a); ->map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >b : Symbol(b, Decl(arrayConcatMap.ts, 1, 15)) >b : Symbol(b, Decl(arrayConcatMap.ts, 1, 15)) diff --git a/tests/baselines/reference/arrayConcatMap.types b/tests/baselines/reference/arrayConcatMap.types index 89289e58d4e18..10e0a74c16db3 100644 --- a/tests/baselines/reference/arrayConcatMap.types +++ b/tests/baselines/reference/arrayConcatMap.types @@ -2,7 +2,7 @@ var x = [].concat([{ a: 1 }], [{ a: 2 }]) >x : any[] >[].concat([{ a: 1 }], [{ a: 2 }]) .map(b => b.a) : any[] ->[].concat([{ a: 1 }], [{ a: 2 }]) .map : (callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any) => U[] +>[].concat([{ a: 1 }], [{ a: 2 }]) .map : { (this: [any, any, any, any, any], callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [any, any, any, any], callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): [U, U, U, U]; (this: [any, any, any], callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): [U, U, U]; (this: [any, any], callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): U[]; } >[].concat([{ a: 1 }], [{ a: 2 }]) : any[] >[].concat : { (...items: any[][]): any[]; (...items: any[]): any[]; } >[] : undefined[] @@ -17,7 +17,7 @@ var x = [].concat([{ a: 1 }], [{ a: 2 }]) >2 : 2 .map(b => b.a); ->map : (callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any) => U[] +>map : { (this: [any, any, any, any, any], callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [any, any, any, any], callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): [U, U, U, U]; (this: [any, any, any], callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): [U, U, U]; (this: [any, any], callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): U[]; } >b => b.a : (b: any) => any >b : any >b.a : any diff --git a/tests/baselines/reference/bestChoiceType.symbols b/tests/baselines/reference/bestChoiceType.symbols index 25f7de2eeda5a..737ba35b520e1 100644 --- a/tests/baselines/reference/bestChoiceType.symbols +++ b/tests/baselines/reference/bestChoiceType.symbols @@ -3,10 +3,10 @@ // Repro from #10041 (''.match(/ /) || []).map(s => s.toLowerCase()); ->(''.match(/ /) || []).map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>(''.match(/ /) || []).map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >''.match : Symbol(String.match, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >match : Symbol(String.match, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >s : Symbol(s, Decl(bestChoiceType.ts, 3, 26)) >s.toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, --, --)) >s : Symbol(s, Decl(bestChoiceType.ts, 3, 26)) @@ -28,9 +28,9 @@ function f1() { let z = y.map(s => s.toLowerCase()); >z : Symbol(z, Decl(bestChoiceType.ts, 10, 7)) ->y.map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>y.map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >y : Symbol(y, Decl(bestChoiceType.ts, 9, 7)) ->map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >s : Symbol(s, Decl(bestChoiceType.ts, 10, 18)) >s.toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, --, --)) >s : Symbol(s, Decl(bestChoiceType.ts, 10, 18)) @@ -52,9 +52,9 @@ function f2() { let z = y.map(s => s.toLowerCase()); >z : Symbol(z, Decl(bestChoiceType.ts, 16, 7)) ->y.map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>y.map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >y : Symbol(y, Decl(bestChoiceType.ts, 15, 7)) ->map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >s : Symbol(s, Decl(bestChoiceType.ts, 16, 18)) >s.toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, --, --)) >s : Symbol(s, Decl(bestChoiceType.ts, 16, 18)) diff --git a/tests/baselines/reference/bestChoiceType.types b/tests/baselines/reference/bestChoiceType.types index b1b4d41975611..07b61fc9f840c 100644 --- a/tests/baselines/reference/bestChoiceType.types +++ b/tests/baselines/reference/bestChoiceType.types @@ -4,7 +4,7 @@ (''.match(/ /) || []).map(s => s.toLowerCase()); >(''.match(/ /) || []).map(s => s.toLowerCase()) : string[] ->(''.match(/ /) || []).map : (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[] +>(''.match(/ /) || []).map : { (this: [string, string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U]; (this: [string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U]; (this: [string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): U[]; } >(''.match(/ /) || []) : RegExpMatchArray >''.match(/ /) || [] : RegExpMatchArray >''.match(/ /) : RegExpMatchArray | null @@ -13,7 +13,7 @@ >match : { (regexp: string): RegExpMatchArray | null; (regexp: RegExp): RegExpMatchArray | null; } >/ / : RegExp >[] : never[] ->map : (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[] +>map : { (this: [string, string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U]; (this: [string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U]; (this: [string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): U[]; } >s => s.toLowerCase() : (s: string) => string >s : string >s.toLowerCase() : string @@ -43,9 +43,9 @@ function f1() { let z = y.map(s => s.toLowerCase()); >z : string[] >y.map(s => s.toLowerCase()) : string[] ->y.map : (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[] +>y.map : { (this: [string, string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U]; (this: [string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U]; (this: [string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): U[]; } >y : RegExpMatchArray ->map : (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[] +>map : { (this: [string, string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U]; (this: [string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U]; (this: [string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): U[]; } >s => s.toLowerCase() : (s: string) => string >s : string >s.toLowerCase() : string @@ -75,9 +75,9 @@ function f2() { let z = y.map(s => s.toLowerCase()); >z : string[] >y.map(s => s.toLowerCase()) : string[] ->y.map : (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[] +>y.map : { (this: [string, string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U]; (this: [string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U]; (this: [string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): U[]; } >y : RegExpMatchArray ->map : (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[] +>map : { (this: [string, string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U]; (this: [string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U]; (this: [string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): U[]; } >s => s.toLowerCase() : (s: string) => string >s : string >s.toLowerCase() : string diff --git a/tests/baselines/reference/commentInMethodCall.symbols b/tests/baselines/reference/commentInMethodCall.symbols index 9db0719cf89a2..1ef762da871d3 100644 --- a/tests/baselines/reference/commentInMethodCall.symbols +++ b/tests/baselines/reference/commentInMethodCall.symbols @@ -4,9 +4,9 @@ var s: string[]; >s : Symbol(s, Decl(commentInMethodCall.ts, 1, 3)) s.map(// do something ->s.map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>s.map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >s : Symbol(s, Decl(commentInMethodCall.ts, 1, 3)) ->map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function () { }); diff --git a/tests/baselines/reference/commentInMethodCall.types b/tests/baselines/reference/commentInMethodCall.types index e9543a8c6f258..a97b031977737 100644 --- a/tests/baselines/reference/commentInMethodCall.types +++ b/tests/baselines/reference/commentInMethodCall.types @@ -5,9 +5,9 @@ var s: string[]; s.map(// do something >s.map(// do something function () { }) : void[] ->s.map : (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[] +>s.map : { (this: [string, string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U]; (this: [string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U]; (this: [string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): U[]; } >s : string[] ->map : (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[] +>map : { (this: [string, string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U]; (this: [string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U]; (this: [string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): U[]; } function () { }); >function () { } : () => void diff --git a/tests/baselines/reference/contextualSignatureInstantiation3.symbols b/tests/baselines/reference/contextualSignatureInstantiation3.symbols index 6d480a7aef42f..50dac0b5d672d 100644 --- a/tests/baselines/reference/contextualSignatureInstantiation3.symbols +++ b/tests/baselines/reference/contextualSignatureInstantiation3.symbols @@ -12,9 +12,9 @@ function map(items: T[], f: (x: T) => U): U[]{ >U : Symbol(U, Decl(contextualSignatureInstantiation3.ts, 0, 15)) return items.map(f); ->items.map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>items.map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >items : Symbol(items, Decl(contextualSignatureInstantiation3.ts, 0, 19)) ->map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >f : Symbol(f, Decl(contextualSignatureInstantiation3.ts, 0, 30)) } @@ -47,9 +47,9 @@ var v1: number[]; var v1 = xs.map(identity); // Error if not number[] >v1 : Symbol(v1, Decl(contextualSignatureInstantiation3.ts, 15, 3), Decl(contextualSignatureInstantiation3.ts, 16, 3), Decl(contextualSignatureInstantiation3.ts, 17, 3)) ->xs.map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>xs.map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >xs : Symbol(xs, Decl(contextualSignatureInstantiation3.ts, 12, 3)) ->map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >identity : Symbol(identity, Decl(contextualSignatureInstantiation3.ts, 2, 1)) var v1 = map(xs, identity); // Error if not number[] @@ -63,9 +63,9 @@ var v2: number[][]; var v2 = xs.map(singleton); // Error if not number[][] >v2 : Symbol(v2, Decl(contextualSignatureInstantiation3.ts, 19, 3), Decl(contextualSignatureInstantiation3.ts, 20, 3), Decl(contextualSignatureInstantiation3.ts, 21, 3)) ->xs.map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>xs.map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >xs : Symbol(xs, Decl(contextualSignatureInstantiation3.ts, 12, 3)) ->map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >singleton : Symbol(singleton, Decl(contextualSignatureInstantiation3.ts, 6, 1)) var v2 = map(xs, singleton); // Error if not number[][] diff --git a/tests/baselines/reference/contextualSignatureInstantiation3.types b/tests/baselines/reference/contextualSignatureInstantiation3.types index 945a4374ad142..409c685215d5b 100644 --- a/tests/baselines/reference/contextualSignatureInstantiation3.types +++ b/tests/baselines/reference/contextualSignatureInstantiation3.types @@ -13,9 +13,9 @@ function map(items: T[], f: (x: T) => U): U[]{ return items.map(f); >items.map(f) : U[] ->items.map : (callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any) => U[] +>items.map : { (this: [T, T, T, T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [T, T, T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U, U, U]; (this: [T, T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U, U]; (this: [T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]; } >items : T[] ->map : (callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any) => U[] +>map : { (this: [T, T, T, T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [T, T, T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U, U, U]; (this: [T, T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U, U]; (this: [T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]; } >f : (x: T) => U } @@ -54,9 +54,9 @@ var v1: number[]; var v1 = xs.map(identity); // Error if not number[] >v1 : number[] >xs.map(identity) : number[] ->xs.map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] +>xs.map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): U[]; } >xs : number[] ->map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] +>map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): U[]; } >identity : (x: T) => T var v1 = map(xs, identity); // Error if not number[] @@ -72,9 +72,9 @@ var v2: number[][]; var v2 = xs.map(singleton); // Error if not number[][] >v2 : number[][] >xs.map(singleton) : number[][] ->xs.map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] +>xs.map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): U[]; } >xs : number[] ->map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] +>map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): U[]; } >singleton : (x: T) => T[] var v2 = map(xs, singleton); // Error if not number[][] diff --git a/tests/baselines/reference/contextuallyTypedIife.symbols b/tests/baselines/reference/contextuallyTypedIife.symbols index 824ce6031ce96..4512b4db8a203 100644 --- a/tests/baselines/reference/contextuallyTypedIife.symbols +++ b/tests/baselines/reference/contextuallyTypedIife.symbols @@ -73,9 +73,9 @@ >first : Symbol(first, Decl(contextuallyTypedIife.ts, 20, 2)) >rest : Symbol(rest, Decl(contextuallyTypedIife.ts, 20, 8)) >first : Symbol(first, Decl(contextuallyTypedIife.ts, 20, 2)) ->rest.map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>rest.map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >rest : Symbol(rest, Decl(contextuallyTypedIife.ts, 20, 8)) ->map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >n : Symbol(n, Decl(contextuallyTypedIife.ts, 20, 43)) >n : Symbol(n, Decl(contextuallyTypedIife.ts, 20, 43)) diff --git a/tests/baselines/reference/contextuallyTypedIife.types b/tests/baselines/reference/contextuallyTypedIife.types index ca0f7f2a5085a..e6f41265e9a11 100644 --- a/tests/baselines/reference/contextuallyTypedIife.types +++ b/tests/baselines/reference/contextuallyTypedIife.types @@ -160,9 +160,9 @@ >first : number >[] : undefined[] >rest.map(n => n > 0) : boolean[] ->rest.map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] +>rest.map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): U[]; } >rest : number[] ->map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] +>map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): U[]; } >n => n > 0 : (n: number) => boolean >n : number >n > 0 : boolean diff --git a/tests/baselines/reference/controlFlowDestructuringParameters.symbols b/tests/baselines/reference/controlFlowDestructuringParameters.symbols index 668d346b92900..58d2edfc12c10 100644 --- a/tests/baselines/reference/controlFlowDestructuringParameters.symbols +++ b/tests/baselines/reference/controlFlowDestructuringParameters.symbols @@ -3,9 +3,9 @@ [{ x: 1 }].map( ->[{ x: 1 }].map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>[{ x: 1 }].map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(controlFlowDestructuringParameters.ts, 3, 2)) ->map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ({ x }) => x >x : Symbol(x, Decl(controlFlowDestructuringParameters.ts, 4, 4)) diff --git a/tests/baselines/reference/controlFlowDestructuringParameters.types b/tests/baselines/reference/controlFlowDestructuringParameters.types index d0729e6d7d561..c38a8fb1aa4fa 100644 --- a/tests/baselines/reference/controlFlowDestructuringParameters.types +++ b/tests/baselines/reference/controlFlowDestructuringParameters.types @@ -4,12 +4,12 @@ [{ x: 1 }].map( >[{ x: 1 }].map( ({ x }) => x) : number[] ->[{ x: 1 }].map : (callbackfn: (value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg?: any) => U[] +>[{ x: 1 }].map : { (this: [{ x: number; }, { x: number; }, { x: number; }, { x: number; }, { x: number; }], callbackfn: (value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [{ x: number; }, { x: number; }, { x: number; }, { x: number; }], callbackfn: (value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg?: any): [U, U, U, U]; (this: [{ x: number; }, { x: number; }, { x: number; }], callbackfn: (value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg?: any): [U, U, U]; (this: [{ x: number; }, { x: number; }], callbackfn: (value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg?: any): U[]; } >[{ x: 1 }] : { x: number; }[] >{ x: 1 } : { x: number; } >x : number >1 : 1 ->map : (callbackfn: (value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg?: any) => U[] +>map : { (this: [{ x: number; }, { x: number; }, { x: number; }, { x: number; }, { x: number; }], callbackfn: (value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [{ x: number; }, { x: number; }, { x: number; }, { x: number; }], callbackfn: (value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg?: any): [U, U, U, U]; (this: [{ x: number; }, { x: number; }, { x: number; }], callbackfn: (value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg?: any): [U, U, U]; (this: [{ x: number; }, { x: number; }], callbackfn: (value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg?: any): U[]; } ({ x }) => x >({ x }) => x : ({x}: { x: number; }) => number diff --git a/tests/baselines/reference/enumIndexer.symbols b/tests/baselines/reference/enumIndexer.symbols index 59191a73276f4..79baee6649812 100644 --- a/tests/baselines/reference/enumIndexer.symbols +++ b/tests/baselines/reference/enumIndexer.symbols @@ -19,9 +19,9 @@ var enumValue = MyEnumType.foo; var x = _arr.map(o => MyEnumType[o.key] === enumValue); // these are not same type >x : Symbol(x, Decl(enumIndexer.ts, 5, 3)) ->_arr.map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>_arr.map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >_arr : Symbol(_arr, Decl(enumIndexer.ts, 3, 3)) ->map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >o : Symbol(o, Decl(enumIndexer.ts, 5, 17)) >MyEnumType : Symbol(MyEnumType, Decl(enumIndexer.ts, 0, 0)) >o.key : Symbol(key, Decl(enumIndexer.ts, 3, 13)) diff --git a/tests/baselines/reference/enumIndexer.types b/tests/baselines/reference/enumIndexer.types index 6c6e50822b517..3abd7eaaa4c21 100644 --- a/tests/baselines/reference/enumIndexer.types +++ b/tests/baselines/reference/enumIndexer.types @@ -25,9 +25,9 @@ var enumValue = MyEnumType.foo; var x = _arr.map(o => MyEnumType[o.key] === enumValue); // these are not same type >x : boolean[] >_arr.map(o => MyEnumType[o.key] === enumValue) : boolean[] ->_arr.map : (callbackfn: (value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg?: any) => U[] +>_arr.map : { (this: [{ key: string; }, { key: string; }, { key: string; }, { key: string; }, { key: string; }], callbackfn: (value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [{ key: string; }, { key: string; }, { key: string; }, { key: string; }], callbackfn: (value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg?: any): [U, U, U, U]; (this: [{ key: string; }, { key: string; }, { key: string; }], callbackfn: (value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg?: any): [U, U, U]; (this: [{ key: string; }, { key: string; }], callbackfn: (value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg?: any): U[]; } >_arr : { key: string; }[] ->map : (callbackfn: (value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg?: any) => U[] +>map : { (this: [{ key: string; }, { key: string; }, { key: string; }, { key: string; }, { key: string; }], callbackfn: (value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [{ key: string; }, { key: string; }, { key: string; }, { key: string; }], callbackfn: (value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg?: any): [U, U, U, U]; (this: [{ key: string; }, { key: string; }, { key: string; }], callbackfn: (value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg?: any): [U, U, U]; (this: [{ key: string; }, { key: string; }], callbackfn: (value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg?: any): U[]; } >o => MyEnumType[o.key] === enumValue : (o: { key: string; }) => boolean >o : { key: string; } >MyEnumType[o.key] === enumValue : boolean diff --git a/tests/baselines/reference/genericArray1.symbols b/tests/baselines/reference/genericArray1.symbols index b73872b8d5545..a96b487f1d77d 100644 --- a/tests/baselines/reference/genericArray1.symbols +++ b/tests/baselines/reference/genericArray1.symbols @@ -13,8 +13,8 @@ interface String{ var lengths = ["a", "b", "c"].map(x => x.length); >lengths : Symbol(lengths, Decl(genericArray1.ts, 12, 3)) ->["a", "b", "c"].map : Symbol(Array.map, Decl(lib.d.ts, --, --)) ->map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>["a", "b", "c"].map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(genericArray1.ts, 12, 34)) >x.length : Symbol(String.length, Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(genericArray1.ts, 12, 34)) diff --git a/tests/baselines/reference/genericArray1.types b/tests/baselines/reference/genericArray1.types index baa2ec8a9cfbf..68d691a96e352 100644 --- a/tests/baselines/reference/genericArray1.types +++ b/tests/baselines/reference/genericArray1.types @@ -14,12 +14,12 @@ interface String{ var lengths = ["a", "b", "c"].map(x => x.length); >lengths : number[] >["a", "b", "c"].map(x => x.length) : number[] ->["a", "b", "c"].map : (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[] +>["a", "b", "c"].map : { (this: [string, string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U]; (this: [string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U]; (this: [string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): U[]; } >["a", "b", "c"] : string[] >"a" : "a" >"b" : "b" >"c" : "c" ->map : (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[] +>map : { (this: [string, string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U]; (this: [string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U]; (this: [string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): U[]; } >x => x.length : (x: string) => number >x : string >x.length : number diff --git a/tests/baselines/reference/genericInference1.symbols b/tests/baselines/reference/genericInference1.symbols index 8beecf272545a..7fc39ac556ffd 100644 --- a/tests/baselines/reference/genericInference1.symbols +++ b/tests/baselines/reference/genericInference1.symbols @@ -1,7 +1,7 @@ === tests/cases/compiler/genericInference1.ts === ['a', 'b', 'c'].map(x => x.length); ->['a', 'b', 'c'].map : Symbol(Array.map, Decl(lib.d.ts, --, --)) ->map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>['a', 'b', 'c'].map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(genericInference1.ts, 0, 20)) >x.length : Symbol(String.length, Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(genericInference1.ts, 0, 20)) diff --git a/tests/baselines/reference/genericInference1.types b/tests/baselines/reference/genericInference1.types index 30b7279ebc0e4..ddf8d76200077 100644 --- a/tests/baselines/reference/genericInference1.types +++ b/tests/baselines/reference/genericInference1.types @@ -1,12 +1,12 @@ === tests/cases/compiler/genericInference1.ts === ['a', 'b', 'c'].map(x => x.length); >['a', 'b', 'c'].map(x => x.length) : number[] ->['a', 'b', 'c'].map : (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[] +>['a', 'b', 'c'].map : { (this: [string, string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U]; (this: [string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U]; (this: [string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): U[]; } >['a', 'b', 'c'] : string[] >'a' : "a" >'b' : "b" >'c' : "c" ->map : (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[] +>map : { (this: [string, string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U]; (this: [string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U]; (this: [string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): U[]; } >x => x.length : (x: string) => number >x : string >x.length : number diff --git a/tests/baselines/reference/genericMethodOverspecialization.symbols b/tests/baselines/reference/genericMethodOverspecialization.symbols index 329ca2de67561..5fd2a0479e672 100644 --- a/tests/baselines/reference/genericMethodOverspecialization.symbols +++ b/tests/baselines/reference/genericMethodOverspecialization.symbols @@ -27,9 +27,9 @@ interface Document { var elements = names.map(function (name) { >elements : Symbol(elements, Decl(genericMethodOverspecialization.ts, 12, 3)) ->names.map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>names.map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >names : Symbol(names, Decl(genericMethodOverspecialization.ts, 0, 3)) ->map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >name : Symbol(name, Decl(genericMethodOverspecialization.ts, 12, 35)) return document.getElementById(name); @@ -57,9 +57,9 @@ var xxx = elements.filter(function (e) { var widths:number[] = elements.map(function (e) { // should not error >widths : Symbol(widths, Decl(genericMethodOverspecialization.ts, 21, 3)) ->elements.map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>elements.map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >elements : Symbol(elements, Decl(genericMethodOverspecialization.ts, 12, 3)) ->map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >e : Symbol(e, Decl(genericMethodOverspecialization.ts, 21, 45)) return e.clientWidth; diff --git a/tests/baselines/reference/genericMethodOverspecialization.types b/tests/baselines/reference/genericMethodOverspecialization.types index 268943a97231e..0f90bd34e2ec3 100644 --- a/tests/baselines/reference/genericMethodOverspecialization.types +++ b/tests/baselines/reference/genericMethodOverspecialization.types @@ -34,9 +34,9 @@ interface Document { var elements = names.map(function (name) { >elements : HTMLElement[] >names.map(function (name) { return document.getElementById(name);}) : HTMLElement[] ->names.map : (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[] +>names.map : { (this: [string, string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U]; (this: [string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U]; (this: [string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): U[]; } >names : string[] ->map : (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[] +>map : { (this: [string, string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U]; (this: [string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U]; (this: [string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): U[]; } >function (name) { return document.getElementById(name);} : (name: string) => HTMLElement >name : string @@ -70,9 +70,9 @@ var xxx = elements.filter(function (e) { var widths:number[] = elements.map(function (e) { // should not error >widths : number[] >elements.map(function (e) { // should not error return e.clientWidth;}) : number[] ->elements.map : (callbackfn: (value: HTMLElement, index: number, array: HTMLElement[]) => U, thisArg?: any) => U[] +>elements.map : { (this: [HTMLElement, HTMLElement, HTMLElement, HTMLElement, HTMLElement], callbackfn: (value: HTMLElement, index: number, array: HTMLElement[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [HTMLElement, HTMLElement, HTMLElement, HTMLElement], callbackfn: (value: HTMLElement, index: number, array: HTMLElement[]) => U, thisArg?: any): [U, U, U, U]; (this: [HTMLElement, HTMLElement, HTMLElement], callbackfn: (value: HTMLElement, index: number, array: HTMLElement[]) => U, thisArg?: any): [U, U, U]; (this: [HTMLElement, HTMLElement], callbackfn: (value: HTMLElement, index: number, array: HTMLElement[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: HTMLElement, index: number, array: HTMLElement[]) => U, thisArg?: any): U[]; } >elements : HTMLElement[] ->map : (callbackfn: (value: HTMLElement, index: number, array: HTMLElement[]) => U, thisArg?: any) => U[] +>map : { (this: [HTMLElement, HTMLElement, HTMLElement, HTMLElement, HTMLElement], callbackfn: (value: HTMLElement, index: number, array: HTMLElement[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [HTMLElement, HTMLElement, HTMLElement, HTMLElement], callbackfn: (value: HTMLElement, index: number, array: HTMLElement[]) => U, thisArg?: any): [U, U, U, U]; (this: [HTMLElement, HTMLElement, HTMLElement], callbackfn: (value: HTMLElement, index: number, array: HTMLElement[]) => U, thisArg?: any): [U, U, U]; (this: [HTMLElement, HTMLElement], callbackfn: (value: HTMLElement, index: number, array: HTMLElement[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: HTMLElement, index: number, array: HTMLElement[]) => U, thisArg?: any): U[]; } >function (e) { // should not error return e.clientWidth;} : (e: HTMLElement) => number >e : HTMLElement diff --git a/tests/baselines/reference/implementArrayInterface.errors.txt b/tests/baselines/reference/implementArrayInterface.errors.txt new file mode 100644 index 0000000000000..08c438ebaf362 --- /dev/null +++ b/tests/baselines/reference/implementArrayInterface.errors.txt @@ -0,0 +1,47 @@ +tests/cases/compiler/implementArrayInterface.ts(1,15): error TS2420: Class 'MyArray' incorrectly implements interface 'T[]'. + Types of property 'map' are incompatible. + Type '(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any) => U[]' is not assignable to type '{ (this: [T, T, T, T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [T, T, T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U, U, U]; (this: [T, T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U, U]; (this: [T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]; }'. + Type 'any[]' is not assignable to type '[any, any, any, any, any]'. + Property '0' is missing in type 'any[]'. + + +==== tests/cases/compiler/implementArrayInterface.ts (1 errors) ==== + declare class MyArray implements Array { + ~~~~~~~ +!!! error TS2420: Class 'MyArray' incorrectly implements interface 'T[]'. +!!! error TS2420: Types of property 'map' are incompatible. +!!! error TS2420: Type '(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any) => U[]' is not assignable to type '{ (this: [T, T, T, T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [T, T, T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U, U, U]; (this: [T, T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U, U]; (this: [T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]; }'. +!!! error TS2420: Type 'any[]' is not assignable to type '[any, any, any, any, any]'. +!!! error TS2420: Property '0' is missing in type 'any[]'. + toString(): string; + toLocaleString(): string; + concat(...items: U[]): T[]; + concat(...items: T[]): T[]; + join(separator?: string): string; + pop(): T; + push(...items: T[]): number; + reverse(): T[]; + shift(): T; + slice(start?: number, end?: number): T[]; + sort(compareFn?: (a: T, b: T) => number): this; + splice(start: number): T[]; + splice(start: number, deleteCount: number, ...items: T[]): T[]; + unshift(...items: T[]): number; + + indexOf(searchElement: T, fromIndex?: number): number; + lastIndexOf(searchElement: T, fromIndex?: number): number; + every(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; + some(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; + forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void; + map(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]; + filter(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): T[]; + reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; + reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; + reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; + reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; + + length: number; + + [n: number]: T; + } + \ No newline at end of file diff --git a/tests/baselines/reference/inferenceLimit.symbols b/tests/baselines/reference/inferenceLimit.symbols index 4601de27b51b8..721e7af7560df 100644 --- a/tests/baselines/reference/inferenceLimit.symbols +++ b/tests/baselines/reference/inferenceLimit.symbols @@ -64,9 +64,9 @@ export class BrokenClass { >Promise.all : Symbol(PromiseConstructor.all, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) >Promise : Symbol(Promise, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) >all : Symbol(PromiseConstructor.all, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->result.map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) +>result.map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >result : Symbol(result, Decl(file1.ts, 10, 7)) ->map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) +>map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >populateItems : Symbol(populateItems, Decl(file1.ts, 12, 7)) .then((orders: Array) => { diff --git a/tests/baselines/reference/inferenceLimit.types b/tests/baselines/reference/inferenceLimit.types index 3801388f3430f..c123e21802ecc 100644 --- a/tests/baselines/reference/inferenceLimit.types +++ b/tests/baselines/reference/inferenceLimit.types @@ -84,9 +84,9 @@ export class BrokenClass { >Promise : PromiseConstructor >all : { (values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>; (values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; (values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>; (values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7]>; (values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6]>; (values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike]): Promise<[T1, T2, T3, T4, T5]>; (values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike]): Promise<[T1, T2, T3, T4]>; (values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[T1, T2, T3]>; (values: [T1 | PromiseLike, T2 | PromiseLike]): Promise<[T1, T2]>; (values: (T | PromiseLike)[]): Promise; (values: Iterable>): Promise; } >result.map(populateItems) : Promise<{}>[] ->result.map : (callbackfn: (value: MyModule.MyModel, index: number, array: MyModule.MyModel[]) => U, thisArg?: any) => U[] +>result.map : { (this: [MyModule.MyModel, MyModule.MyModel, MyModule.MyModel, MyModule.MyModel, MyModule.MyModel], callbackfn: (value: MyModule.MyModel, index: number, array: MyModule.MyModel[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [MyModule.MyModel, MyModule.MyModel, MyModule.MyModel, MyModule.MyModel], callbackfn: (value: MyModule.MyModel, index: number, array: MyModule.MyModel[]) => U, thisArg?: any): [U, U, U, U]; (this: [MyModule.MyModel, MyModule.MyModel, MyModule.MyModel], callbackfn: (value: MyModule.MyModel, index: number, array: MyModule.MyModel[]) => U, thisArg?: any): [U, U, U]; (this: [MyModule.MyModel, MyModule.MyModel], callbackfn: (value: MyModule.MyModel, index: number, array: MyModule.MyModel[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: MyModule.MyModel, index: number, array: MyModule.MyModel[]) => U, thisArg?: any): U[]; } >result : MyModule.MyModel[] ->map : (callbackfn: (value: MyModule.MyModel, index: number, array: MyModule.MyModel[]) => U, thisArg?: any) => U[] +>map : { (this: [MyModule.MyModel, MyModule.MyModel, MyModule.MyModel, MyModule.MyModel, MyModule.MyModel], callbackfn: (value: MyModule.MyModel, index: number, array: MyModule.MyModel[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [MyModule.MyModel, MyModule.MyModel, MyModule.MyModel, MyModule.MyModel], callbackfn: (value: MyModule.MyModel, index: number, array: MyModule.MyModel[]) => U, thisArg?: any): [U, U, U, U]; (this: [MyModule.MyModel, MyModule.MyModel, MyModule.MyModel], callbackfn: (value: MyModule.MyModel, index: number, array: MyModule.MyModel[]) => U, thisArg?: any): [U, U, U]; (this: [MyModule.MyModel, MyModule.MyModel], callbackfn: (value: MyModule.MyModel, index: number, array: MyModule.MyModel[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: MyModule.MyModel, index: number, array: MyModule.MyModel[]) => U, thisArg?: any): U[]; } >populateItems : (order: any) => Promise<{}> .then((orders: Array) => { diff --git a/tests/baselines/reference/inferentialTypingWithFunctionType2.symbols b/tests/baselines/reference/inferentialTypingWithFunctionType2.symbols index c6ac17b0ccb24..56d2c2dc87fc7 100644 --- a/tests/baselines/reference/inferentialTypingWithFunctionType2.symbols +++ b/tests/baselines/reference/inferentialTypingWithFunctionType2.symbols @@ -11,7 +11,7 @@ function identity(a: A): A { } var x = [1, 2, 3].map(identity)[0]; >x : Symbol(x, Decl(inferentialTypingWithFunctionType2.ts, 3, 3)) ->[1, 2, 3].map : Symbol(Array.map, Decl(lib.d.ts, --, --)) ->map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>[1, 2, 3].map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >identity : Symbol(identity, Decl(inferentialTypingWithFunctionType2.ts, 0, 0)) diff --git a/tests/baselines/reference/inferentialTypingWithFunctionType2.types b/tests/baselines/reference/inferentialTypingWithFunctionType2.types index 2c4bb2542fbe0..b9208409fe0ec 100644 --- a/tests/baselines/reference/inferentialTypingWithFunctionType2.types +++ b/tests/baselines/reference/inferentialTypingWithFunctionType2.types @@ -13,12 +13,12 @@ var x = [1, 2, 3].map(identity)[0]; >x : number >[1, 2, 3].map(identity)[0] : number >[1, 2, 3].map(identity) : number[] ->[1, 2, 3].map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] +>[1, 2, 3].map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): U[]; } >[1, 2, 3] : number[] >1 : 1 >2 : 2 >3 : 3 ->map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] +>map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): U[]; } >identity : (a: A) => A >0 : 0 diff --git a/tests/baselines/reference/mapOnTupleTypes01.js b/tests/baselines/reference/mapOnTupleTypes01.js index 6c51cf3e6a38e..cb1de5fdc6170 100644 --- a/tests/baselines/reference/mapOnTupleTypes01.js +++ b/tests/baselines/reference/mapOnTupleTypes01.js @@ -72,10 +72,10 @@ exports.h = numNumNumNumNum.map(function (n) { return n * n; }); //// [mapOnTupleTypes01.d.ts] export declare let mapOnLooseArrayLiteral: number[]; export declare let a: number[]; -export declare let b: number[]; -export declare let c: number[]; -export declare let d: (string | number)[]; -export declare let e: number[]; -export declare let f: number[]; -export declare let g: number[]; -export declare let h: number[]; +export declare let b: [number, number]; +export declare let c: [number, number]; +export declare let d: [string | number, string | number]; +export declare let e: [number, number, number]; +export declare let f: [number, number, number, number]; +export declare let g: [number, number, number, number, number]; +export declare let h: [number, number, number, number, number]; diff --git a/tests/baselines/reference/mapOnTupleTypes01.symbols b/tests/baselines/reference/mapOnTupleTypes01.symbols index 1c735fc06cfb5..1dbfca4a4c3b7 100644 --- a/tests/baselines/reference/mapOnTupleTypes01.symbols +++ b/tests/baselines/reference/mapOnTupleTypes01.symbols @@ -2,8 +2,8 @@ export let mapOnLooseArrayLiteral = [1, 2, 3, 4].map(n => n * n); >mapOnLooseArrayLiteral : Symbol(mapOnLooseArrayLiteral, Decl(mapOnTupleTypes01.ts, 1, 10)) ->[1, 2, 3, 4].map : Symbol(Array.map, Decl(lib.d.ts, --, --)) ->map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>[1, 2, 3, 4].map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >n : Symbol(n, Decl(mapOnTupleTypes01.ts, 1, 53)) >n : Symbol(n, Decl(mapOnTupleTypes01.ts, 1, 53)) >n : Symbol(n, Decl(mapOnTupleTypes01.ts, 1, 53)) @@ -15,9 +15,9 @@ let numTuple: [number] = [1]; export let a = numTuple.map(x => x * x); >a : Symbol(a, Decl(mapOnTupleTypes01.ts, 6, 10)) ->numTuple.map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>numTuple.map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >numTuple : Symbol(numTuple, Decl(mapOnTupleTypes01.ts, 5, 3)) ->map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(mapOnTupleTypes01.ts, 6, 28)) >x : Symbol(x, Decl(mapOnTupleTypes01.ts, 6, 28)) >x : Symbol(x, Decl(mapOnTupleTypes01.ts, 6, 28)) @@ -35,18 +35,18 @@ let numStr: [number, string] = [ 100, "hello"]; export let b = numNum.map(n => n * n); >b : Symbol(b, Decl(mapOnTupleTypes01.ts, 14, 10)) ->numNum.map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>numNum.map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >numNum : Symbol(numNum, Decl(mapOnTupleTypes01.ts, 10, 3)) ->map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >n : Symbol(n, Decl(mapOnTupleTypes01.ts, 14, 26)) >n : Symbol(n, Decl(mapOnTupleTypes01.ts, 14, 26)) >n : Symbol(n, Decl(mapOnTupleTypes01.ts, 14, 26)) export let c = strStr.map(s => s.charCodeAt(0)); >c : Symbol(c, Decl(mapOnTupleTypes01.ts, 15, 10)) ->strStr.map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>strStr.map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >strStr : Symbol(strStr, Decl(mapOnTupleTypes01.ts, 11, 3)) ->map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >s : Symbol(s, Decl(mapOnTupleTypes01.ts, 15, 26)) >s.charCodeAt : Symbol(String.charCodeAt, Decl(lib.d.ts, --, --)) >s : Symbol(s, Decl(mapOnTupleTypes01.ts, 15, 26)) @@ -54,9 +54,9 @@ export let c = strStr.map(s => s.charCodeAt(0)); export let d = numStr.map(x => x); >d : Symbol(d, Decl(mapOnTupleTypes01.ts, 16, 10)) ->numStr.map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>numStr.map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >numStr : Symbol(numStr, Decl(mapOnTupleTypes01.ts, 12, 3)) ->map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(mapOnTupleTypes01.ts, 16, 26)) >x : Symbol(x, Decl(mapOnTupleTypes01.ts, 16, 26)) @@ -67,9 +67,9 @@ let numNumNum: [number, number, number] = [1, 2, 3]; export let e = numNumNum.map(n => n * n); >e : Symbol(e, Decl(mapOnTupleTypes01.ts, 22, 10)) ->numNumNum.map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>numNumNum.map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >numNumNum : Symbol(numNumNum, Decl(mapOnTupleTypes01.ts, 20, 3)) ->map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >n : Symbol(n, Decl(mapOnTupleTypes01.ts, 22, 29)) >n : Symbol(n, Decl(mapOnTupleTypes01.ts, 22, 29)) >n : Symbol(n, Decl(mapOnTupleTypes01.ts, 22, 29)) @@ -81,9 +81,9 @@ let numNumNumNum: [number, number, number, number] = [1, 2, 3, 4]; export let f = numNumNumNum.map(n => n * n); >f : Symbol(f, Decl(mapOnTupleTypes01.ts, 28, 10)) ->numNumNumNum.map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>numNumNumNum.map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >numNumNumNum : Symbol(numNumNumNum, Decl(mapOnTupleTypes01.ts, 26, 3)) ->map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >n : Symbol(n, Decl(mapOnTupleTypes01.ts, 28, 32)) >n : Symbol(n, Decl(mapOnTupleTypes01.ts, 28, 32)) >n : Symbol(n, Decl(mapOnTupleTypes01.ts, 28, 32)) @@ -95,9 +95,9 @@ let numNumNumNumNum: [number, number, number, number, number] = [1, 2, 3, 4, 5]; export let g = numNumNumNumNum.map(n => n * n); >g : Symbol(g, Decl(mapOnTupleTypes01.ts, 34, 10)) ->numNumNumNumNum.map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>numNumNumNumNum.map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >numNumNumNumNum : Symbol(numNumNumNumNum, Decl(mapOnTupleTypes01.ts, 32, 3)) ->map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >n : Symbol(n, Decl(mapOnTupleTypes01.ts, 34, 35)) >n : Symbol(n, Decl(mapOnTupleTypes01.ts, 34, 35)) >n : Symbol(n, Decl(mapOnTupleTypes01.ts, 34, 35)) @@ -110,9 +110,9 @@ let numNumNumNumNumNum: [number, number, number, number, number, number] = [1, 2 export let h = numNumNumNumNum.map(n => n * n); >h : Symbol(h, Decl(mapOnTupleTypes01.ts, 41, 10)) ->numNumNumNumNum.map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>numNumNumNumNum.map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >numNumNumNumNum : Symbol(numNumNumNumNum, Decl(mapOnTupleTypes01.ts, 32, 3)) ->map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >n : Symbol(n, Decl(mapOnTupleTypes01.ts, 41, 35)) >n : Symbol(n, Decl(mapOnTupleTypes01.ts, 41, 35)) >n : Symbol(n, Decl(mapOnTupleTypes01.ts, 41, 35)) diff --git a/tests/baselines/reference/mapOnTupleTypes01.types b/tests/baselines/reference/mapOnTupleTypes01.types index b97b9570fa17e..0a01ecfa3805b 100644 --- a/tests/baselines/reference/mapOnTupleTypes01.types +++ b/tests/baselines/reference/mapOnTupleTypes01.types @@ -3,13 +3,13 @@ export let mapOnLooseArrayLiteral = [1, 2, 3, 4].map(n => n * n); >mapOnLooseArrayLiteral : number[] >[1, 2, 3, 4].map(n => n * n) : number[] ->[1, 2, 3, 4].map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] +>[1, 2, 3, 4].map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): U[]; } >[1, 2, 3, 4] : number[] >1 : 1 >2 : 2 >3 : 3 >4 : 4 ->map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] +>map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): U[]; } >n => n * n : (n: number) => number >n : number >n * n : number @@ -26,9 +26,9 @@ let numTuple: [number] = [1]; export let a = numTuple.map(x => x * x); >a : number[] >numTuple.map(x => x * x) : number[] ->numTuple.map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] +>numTuple.map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): U[]; } >numTuple : [number] ->map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] +>map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): U[]; } >x => x * x : (x: number) => number >x : number >x * x : number @@ -56,11 +56,11 @@ let numStr: [number, string] = [ 100, "hello"]; >"hello" : "hello" export let b = numNum.map(n => n * n); ->b : number[] ->numNum.map(n => n * n) : number[] ->numNum.map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] +>b : [number, number] +>numNum.map(n => n * n) : [number, number] +>numNum.map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): U[]; } >numNum : [number, number] ->map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] +>map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): U[]; } >n => n * n : (n: number) => number >n : number >n * n : number @@ -68,11 +68,11 @@ export let b = numNum.map(n => n * n); >n : number export let c = strStr.map(s => s.charCodeAt(0)); ->c : number[] ->strStr.map(s => s.charCodeAt(0)) : number[] ->strStr.map : (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[] +>c : [number, number] +>strStr.map(s => s.charCodeAt(0)) : [number, number] +>strStr.map : { (this: [string, string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U]; (this: [string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U]; (this: [string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): U[]; } >strStr : [string, string] ->map : (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[] +>map : { (this: [string, string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U]; (this: [string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U]; (this: [string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): U[]; } >s => s.charCodeAt(0) : (s: string) => number >s : string >s.charCodeAt(0) : number @@ -82,11 +82,11 @@ export let c = strStr.map(s => s.charCodeAt(0)); >0 : 0 export let d = numStr.map(x => x); ->d : (string | number)[] ->numStr.map(x => x) : (string | number)[] ->numStr.map : (callbackfn: (value: string | number, index: number, array: (string | number)[]) => U, thisArg?: any) => U[] +>d : [string | number, string | number] +>numStr.map(x => x) : [string | number, string | number] +>numStr.map : { (this: [string | number, string | number, string | number, string | number, string | number], callbackfn: (value: string | number, index: number, array: (string | number)[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [string | number, string | number, string | number, string | number], callbackfn: (value: string | number, index: number, array: (string | number)[]) => U, thisArg?: any): [U, U, U, U]; (this: [string | number, string | number, string | number], callbackfn: (value: string | number, index: number, array: (string | number)[]) => U, thisArg?: any): [U, U, U]; (this: [string | number, string | number], callbackfn: (value: string | number, index: number, array: (string | number)[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: string | number, index: number, array: (string | number)[]) => U, thisArg?: any): U[]; } >numStr : [number, string] ->map : (callbackfn: (value: string | number, index: number, array: (string | number)[]) => U, thisArg?: any) => U[] +>map : { (this: [string | number, string | number, string | number, string | number, string | number], callbackfn: (value: string | number, index: number, array: (string | number)[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [string | number, string | number, string | number, string | number], callbackfn: (value: string | number, index: number, array: (string | number)[]) => U, thisArg?: any): [U, U, U, U]; (this: [string | number, string | number, string | number], callbackfn: (value: string | number, index: number, array: (string | number)[]) => U, thisArg?: any): [U, U, U]; (this: [string | number, string | number], callbackfn: (value: string | number, index: number, array: (string | number)[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: string | number, index: number, array: (string | number)[]) => U, thisArg?: any): U[]; } >x => x : (x: string | number) => string | number >x : string | number >x : string | number @@ -101,11 +101,11 @@ let numNumNum: [number, number, number] = [1, 2, 3]; >3 : 3 export let e = numNumNum.map(n => n * n); ->e : number[] ->numNumNum.map(n => n * n) : number[] ->numNumNum.map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] +>e : [number, number, number] +>numNumNum.map(n => n * n) : [number, number, number] +>numNumNum.map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): U[]; } >numNumNum : [number, number, number] ->map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] +>map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): U[]; } >n => n * n : (n: number) => number >n : number >n * n : number @@ -123,11 +123,11 @@ let numNumNumNum: [number, number, number, number] = [1, 2, 3, 4]; >4 : 4 export let f = numNumNumNum.map(n => n * n); ->f : number[] ->numNumNumNum.map(n => n * n) : number[] ->numNumNumNum.map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] +>f : [number, number, number, number] +>numNumNumNum.map(n => n * n) : [number, number, number, number] +>numNumNumNum.map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): U[]; } >numNumNumNum : [number, number, number, number] ->map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] +>map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): U[]; } >n => n * n : (n: number) => number >n : number >n * n : number @@ -146,11 +146,11 @@ let numNumNumNumNum: [number, number, number, number, number] = [1, 2, 3, 4, 5]; >5 : 5 export let g = numNumNumNumNum.map(n => n * n); ->g : number[] ->numNumNumNumNum.map(n => n * n) : number[] ->numNumNumNumNum.map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] +>g : [number, number, number, number, number] +>numNumNumNumNum.map(n => n * n) : [number, number, number, number, number] +>numNumNumNumNum.map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): U[]; } >numNumNumNumNum : [number, number, number, number, number] ->map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] +>map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): U[]; } >n => n * n : (n: number) => number >n : number >n * n : number @@ -171,11 +171,11 @@ let numNumNumNumNumNum: [number, number, number, number, number, number] = [1, 2 >6 : 6 export let h = numNumNumNumNum.map(n => n * n); ->h : number[] ->numNumNumNumNum.map(n => n * n) : number[] ->numNumNumNumNum.map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] +>h : [number, number, number, number, number] +>numNumNumNumNum.map(n => n * n) : [number, number, number, number, number] +>numNumNumNumNum.map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): U[]; } >numNumNumNumNum : [number, number, number, number, number] ->map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] +>map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): U[]; } >n => n * n : (n: number) => number >n : number >n * n : number diff --git a/tests/baselines/reference/mapOnTupleTypes02.js b/tests/baselines/reference/mapOnTupleTypes02.js index 0f5f59f32858a..97ffc9510db5d 100644 --- a/tests/baselines/reference/mapOnTupleTypes02.js +++ b/tests/baselines/reference/mapOnTupleTypes02.js @@ -16,4 +16,4 @@ exports.increment = increment; //// [mapOnTupleTypes02.d.ts] export declare type Point = [number, number]; -export declare function increment(point: Point): number[]; +export declare function increment(point: Point): [number, number]; diff --git a/tests/baselines/reference/mapOnTupleTypes02.symbols b/tests/baselines/reference/mapOnTupleTypes02.symbols index e0f1ca79f6134..da27a13d4f66b 100644 --- a/tests/baselines/reference/mapOnTupleTypes02.symbols +++ b/tests/baselines/reference/mapOnTupleTypes02.symbols @@ -9,9 +9,9 @@ export function increment(point: Point) { >Point : Symbol(Point, Decl(mapOnTupleTypes02.ts, 0, 0)) return point.map(d => d + 1); ->point.map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>point.map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >point : Symbol(point, Decl(mapOnTupleTypes02.ts, 3, 26)) ->map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >d : Symbol(d, Decl(mapOnTupleTypes02.ts, 4, 19)) >d : Symbol(d, Decl(mapOnTupleTypes02.ts, 4, 19)) } diff --git a/tests/baselines/reference/mapOnTupleTypes02.types b/tests/baselines/reference/mapOnTupleTypes02.types index bb261f3093add..3803e3c319e1d 100644 --- a/tests/baselines/reference/mapOnTupleTypes02.types +++ b/tests/baselines/reference/mapOnTupleTypes02.types @@ -4,15 +4,15 @@ export type Point = [number, number]; >Point : [number, number] export function increment(point: Point) { ->increment : (point: [number, number]) => number[] +>increment : (point: [number, number]) => [number, number] >point : [number, number] >Point : [number, number] return point.map(d => d + 1); ->point.map(d => d + 1) : number[] ->point.map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] +>point.map(d => d + 1) : [number, number] +>point.map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): U[]; } >point : [number, number] ->map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] +>map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): U[]; } >d => d + 1 : (d: number) => number >d : number >d + 1 : number diff --git a/tests/baselines/reference/nestedSelf.symbols b/tests/baselines/reference/nestedSelf.symbols index 50bdd9981e242..b9a9e91d36d35 100644 --- a/tests/baselines/reference/nestedSelf.symbols +++ b/tests/baselines/reference/nestedSelf.symbols @@ -10,8 +10,8 @@ module M { public foo() { [1,2,3].map((x) => { return this.n * x; })} >foo : Symbol(C.foo, Decl(nestedSelf.ts, 2, 17)) ->[1,2,3].map : Symbol(Array.map, Decl(lib.d.ts, --, --)) ->map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>[1,2,3].map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(nestedSelf.ts, 3, 31)) >this.n : Symbol(C.n, Decl(nestedSelf.ts, 1, 17)) >this : Symbol(C, Decl(nestedSelf.ts, 0, 10)) diff --git a/tests/baselines/reference/nestedSelf.types b/tests/baselines/reference/nestedSelf.types index 9fb4b0bd65dcf..1ec95a8d24ab1 100644 --- a/tests/baselines/reference/nestedSelf.types +++ b/tests/baselines/reference/nestedSelf.types @@ -12,12 +12,12 @@ module M { public foo() { [1,2,3].map((x) => { return this.n * x; })} >foo : () => void >[1,2,3].map((x) => { return this.n * x; }) : number[] ->[1,2,3].map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] +>[1,2,3].map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): U[]; } >[1,2,3] : number[] >1 : 1 >2 : 2 >3 : 3 ->map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] +>map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): U[]; } >(x) => { return this.n * x; } : (x: number) => number >x : number >this.n * x : number diff --git a/tests/baselines/reference/simpleArrowFunctionParameterReferencedInObjectLiteral1.symbols b/tests/baselines/reference/simpleArrowFunctionParameterReferencedInObjectLiteral1.symbols index 495282578302d..23a1df2565351 100644 --- a/tests/baselines/reference/simpleArrowFunctionParameterReferencedInObjectLiteral1.symbols +++ b/tests/baselines/reference/simpleArrowFunctionParameterReferencedInObjectLiteral1.symbols @@ -1,9 +1,9 @@ === tests/cases/compiler/simpleArrowFunctionParameterReferencedInObjectLiteral1.ts === [].map(() => [].map(p => ({ X: p }))); ->[].map : Symbol(Array.map, Decl(lib.d.ts, --, --)) ->map : Symbol(Array.map, Decl(lib.d.ts, --, --)) ->[].map : Symbol(Array.map, Decl(lib.d.ts, --, --)) ->map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>[].map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>[].map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >p : Symbol(p, Decl(simpleArrowFunctionParameterReferencedInObjectLiteral1.ts, 0, 20)) >X : Symbol(X, Decl(simpleArrowFunctionParameterReferencedInObjectLiteral1.ts, 0, 27)) >p : Symbol(p, Decl(simpleArrowFunctionParameterReferencedInObjectLiteral1.ts, 0, 20)) diff --git a/tests/baselines/reference/simpleArrowFunctionParameterReferencedInObjectLiteral1.types b/tests/baselines/reference/simpleArrowFunctionParameterReferencedInObjectLiteral1.types index 417a51ac4b801..ff1640909d9ff 100644 --- a/tests/baselines/reference/simpleArrowFunctionParameterReferencedInObjectLiteral1.types +++ b/tests/baselines/reference/simpleArrowFunctionParameterReferencedInObjectLiteral1.types @@ -1,14 +1,14 @@ === tests/cases/compiler/simpleArrowFunctionParameterReferencedInObjectLiteral1.ts === [].map(() => [].map(p => ({ X: p }))); >[].map(() => [].map(p => ({ X: p }))) : { X: any; }[][] ->[].map : (callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any) => U[] +>[].map : { (this: [any, any, any, any, any], callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [any, any, any, any], callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): [U, U, U, U]; (this: [any, any, any], callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): [U, U, U]; (this: [any, any], callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): U[]; } >[] : undefined[] ->map : (callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any) => U[] +>map : { (this: [any, any, any, any, any], callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [any, any, any, any], callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): [U, U, U, U]; (this: [any, any, any], callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): [U, U, U]; (this: [any, any], callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): U[]; } >() => [].map(p => ({ X: p })) : () => { X: any; }[] >[].map(p => ({ X: p })) : { X: any; }[] ->[].map : (callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any) => U[] +>[].map : { (this: [any, any, any, any, any], callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [any, any, any, any], callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): [U, U, U, U]; (this: [any, any, any], callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): [U, U, U]; (this: [any, any], callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): U[]; } >[] : undefined[] ->map : (callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any) => U[] +>map : { (this: [any, any, any, any, any], callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [any, any, any, any], callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): [U, U, U, U]; (this: [any, any, any], callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): [U, U, U]; (this: [any, any], callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): U[]; } >p => ({ X: p }) : (p: any) => { X: any; } >p : any >({ X: p }) : { X: any; } diff --git a/tests/baselines/reference/specializationsShouldNotAffectEachOther.symbols b/tests/baselines/reference/specializationsShouldNotAffectEachOther.symbols index 5c93a74fe51f0..7d5a6d979b3a7 100644 --- a/tests/baselines/reference/specializationsShouldNotAffectEachOther.symbols +++ b/tests/baselines/reference/specializationsShouldNotAffectEachOther.symbols @@ -23,9 +23,9 @@ function foo() { >series2 : Symbol(series2, Decl(specializationsShouldNotAffectEachOther.ts, 12, 7)) series2.map(seriesExtent); ->series2.map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>series2.map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >series2 : Symbol(series2, Decl(specializationsShouldNotAffectEachOther.ts, 12, 7)) ->map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >seriesExtent : Symbol(seriesExtent, Decl(specializationsShouldNotAffectEachOther.ts, 10, 7)) return null; @@ -34,11 +34,11 @@ function foo() { var keyExtent2: any[] = series.data.map(function (d: string) { return d; }); >keyExtent2 : Symbol(keyExtent2, Decl(specializationsShouldNotAffectEachOther.ts, 19, 3)) ->series.data.map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>series.data.map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >series.data : Symbol(Series.data, Decl(specializationsShouldNotAffectEachOther.ts, 1, 19)) >series : Symbol(series, Decl(specializationsShouldNotAffectEachOther.ts, 5, 3)) >data : Symbol(Series.data, Decl(specializationsShouldNotAffectEachOther.ts, 1, 19)) ->map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >d : Symbol(d, Decl(specializationsShouldNotAffectEachOther.ts, 19, 50)) >d : Symbol(d, Decl(specializationsShouldNotAffectEachOther.ts, 19, 50)) diff --git a/tests/baselines/reference/specializationsShouldNotAffectEachOther.types b/tests/baselines/reference/specializationsShouldNotAffectEachOther.types index f666fd8fe21c6..aa14eca0508e6 100644 --- a/tests/baselines/reference/specializationsShouldNotAffectEachOther.types +++ b/tests/baselines/reference/specializationsShouldNotAffectEachOther.types @@ -26,9 +26,9 @@ function foo() { series2.map(seriesExtent); >series2.map(seriesExtent) : any[] ->series2.map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] +>series2.map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): U[]; } >series2 : number[] ->map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] +>map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): U[]; } >seriesExtent : (series: any) => any return null; @@ -39,11 +39,11 @@ function foo() { var keyExtent2: any[] = series.data.map(function (d: string) { return d; }); >keyExtent2 : any[] >series.data.map(function (d: string) { return d; }) : string[] ->series.data.map : (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[] +>series.data.map : { (this: [string, string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U]; (this: [string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U]; (this: [string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): U[]; } >series.data : string[] >series : Series >data : string[] ->map : (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[] +>map : { (this: [string, string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U]; (this: [string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U]; (this: [string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): U[]; } >function (d: string) { return d; } : (d: string) => string >d : string >d : string diff --git a/tests/baselines/reference/typeArgumentInferenceWithRecursivelyReferencedTypeAliasToTypeLiteral01.symbols b/tests/baselines/reference/typeArgumentInferenceWithRecursivelyReferencedTypeAliasToTypeLiteral01.symbols index b73bd8882d280..766c75e2c1303 100644 --- a/tests/baselines/reference/typeArgumentInferenceWithRecursivelyReferencedTypeAliasToTypeLiteral01.symbols +++ b/tests/baselines/reference/typeArgumentInferenceWithRecursivelyReferencedTypeAliasToTypeLiteral01.symbols @@ -15,9 +15,9 @@ var nodes: TreeNode[]; >TreeNode : Symbol(TreeNode, Decl(typeArgumentInferenceWithRecursivelyReferencedTypeAliasToTypeLiteral01.ts, 0, 0)) nodes.map(n => n.name); ->nodes.map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>nodes.map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >nodes : Symbol(nodes, Decl(typeArgumentInferenceWithRecursivelyReferencedTypeAliasToTypeLiteral01.ts, 5, 3)) ->map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >n : Symbol(n, Decl(typeArgumentInferenceWithRecursivelyReferencedTypeAliasToTypeLiteral01.ts, 6, 10)) >n.name : Symbol(name, Decl(typeArgumentInferenceWithRecursivelyReferencedTypeAliasToTypeLiteral01.ts, 0, 17)) >n : Symbol(n, Decl(typeArgumentInferenceWithRecursivelyReferencedTypeAliasToTypeLiteral01.ts, 6, 10)) diff --git a/tests/baselines/reference/typeArgumentInferenceWithRecursivelyReferencedTypeAliasToTypeLiteral01.types b/tests/baselines/reference/typeArgumentInferenceWithRecursivelyReferencedTypeAliasToTypeLiteral01.types index 5269bd9b5186c..045b5e65da323 100644 --- a/tests/baselines/reference/typeArgumentInferenceWithRecursivelyReferencedTypeAliasToTypeLiteral01.types +++ b/tests/baselines/reference/typeArgumentInferenceWithRecursivelyReferencedTypeAliasToTypeLiteral01.types @@ -16,9 +16,9 @@ var nodes: TreeNode[]; nodes.map(n => n.name); >nodes.map(n => n.name) : string[] ->nodes.map : (callbackfn: (value: TreeNode, index: number, array: TreeNode[]) => U, thisArg?: any) => U[] +>nodes.map : { (this: [TreeNode, TreeNode, TreeNode, TreeNode, TreeNode], callbackfn: (value: TreeNode, index: number, array: TreeNode[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [TreeNode, TreeNode, TreeNode, TreeNode], callbackfn: (value: TreeNode, index: number, array: TreeNode[]) => U, thisArg?: any): [U, U, U, U]; (this: [TreeNode, TreeNode, TreeNode], callbackfn: (value: TreeNode, index: number, array: TreeNode[]) => U, thisArg?: any): [U, U, U]; (this: [TreeNode, TreeNode], callbackfn: (value: TreeNode, index: number, array: TreeNode[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: TreeNode, index: number, array: TreeNode[]) => U, thisArg?: any): U[]; } >nodes : TreeNode[] ->map : (callbackfn: (value: TreeNode, index: number, array: TreeNode[]) => U, thisArg?: any) => U[] +>map : { (this: [TreeNode, TreeNode, TreeNode, TreeNode, TreeNode], callbackfn: (value: TreeNode, index: number, array: TreeNode[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [TreeNode, TreeNode, TreeNode, TreeNode], callbackfn: (value: TreeNode, index: number, array: TreeNode[]) => U, thisArg?: any): [U, U, U, U]; (this: [TreeNode, TreeNode, TreeNode], callbackfn: (value: TreeNode, index: number, array: TreeNode[]) => U, thisArg?: any): [U, U, U]; (this: [TreeNode, TreeNode], callbackfn: (value: TreeNode, index: number, array: TreeNode[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: TreeNode, index: number, array: TreeNode[]) => U, thisArg?: any): U[]; } >n => n.name : (n: TreeNode) => string >n : TreeNode >n.name : string diff --git a/tests/baselines/reference/typeArgumentInferenceWithRecursivelyReferencedTypeAliasToTypeLiteral02.symbols b/tests/baselines/reference/typeArgumentInferenceWithRecursivelyReferencedTypeAliasToTypeLiteral02.symbols index 7cec46cb4b655..62e2b3988272d 100644 --- a/tests/baselines/reference/typeArgumentInferenceWithRecursivelyReferencedTypeAliasToTypeLiteral02.symbols +++ b/tests/baselines/reference/typeArgumentInferenceWithRecursivelyReferencedTypeAliasToTypeLiteral02.symbols @@ -26,9 +26,9 @@ var nodes: TreeNodeMiddleman[]; >TreeNodeMiddleman : Symbol(TreeNodeMiddleman, Decl(typeArgumentInferenceWithRecursivelyReferencedTypeAliasToTypeLiteral02.ts, 3, 1)) nodes.map(n => n.name); ->nodes.map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>nodes.map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >nodes : Symbol(nodes, Decl(typeArgumentInferenceWithRecursivelyReferencedTypeAliasToTypeLiteral02.ts, 10, 3)) ->map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >n : Symbol(n, Decl(typeArgumentInferenceWithRecursivelyReferencedTypeAliasToTypeLiteral02.ts, 11, 10)) >n.name : Symbol(name, Decl(typeArgumentInferenceWithRecursivelyReferencedTypeAliasToTypeLiteral02.ts, 5, 26)) >n : Symbol(n, Decl(typeArgumentInferenceWithRecursivelyReferencedTypeAliasToTypeLiteral02.ts, 11, 10)) diff --git a/tests/baselines/reference/typeArgumentInferenceWithRecursivelyReferencedTypeAliasToTypeLiteral02.types b/tests/baselines/reference/typeArgumentInferenceWithRecursivelyReferencedTypeAliasToTypeLiteral02.types index fec665f3f616a..6e3997c2d1fc9 100644 --- a/tests/baselines/reference/typeArgumentInferenceWithRecursivelyReferencedTypeAliasToTypeLiteral02.types +++ b/tests/baselines/reference/typeArgumentInferenceWithRecursivelyReferencedTypeAliasToTypeLiteral02.types @@ -27,9 +27,9 @@ var nodes: TreeNodeMiddleman[]; nodes.map(n => n.name); >nodes.map(n => n.name) : string[] ->nodes.map : (callbackfn: (value: { name: string; parent: TreeNode; }, index: number, array: { name: string; parent: TreeNode; }[]) => U, thisArg?: any) => U[] +>nodes.map : { (this: [{ name: string; parent: TreeNode; }, { name: string; parent: TreeNode; }, { name: string; parent: TreeNode; }, { name: string; parent: TreeNode; }, { name: string; parent: TreeNode; }], callbackfn: (value: { name: string; parent: TreeNode; }, index: number, array: { name: string; parent: TreeNode; }[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [{ name: string; parent: TreeNode; }, { name: string; parent: TreeNode; }, { name: string; parent: TreeNode; }, { name: string; parent: TreeNode; }], callbackfn: (value: { name: string; parent: TreeNode; }, index: number, array: { name: string; parent: TreeNode; }[]) => U, thisArg?: any): [U, U, U, U]; (this: [{ name: string; parent: TreeNode; }, { name: string; parent: TreeNode; }, { name: string; parent: TreeNode; }], callbackfn: (value: { name: string; parent: TreeNode; }, index: number, array: { name: string; parent: TreeNode; }[]) => U, thisArg?: any): [U, U, U]; (this: [{ name: string; parent: TreeNode; }, { name: string; parent: TreeNode; }], callbackfn: (value: { name: string; parent: TreeNode; }, index: number, array: { name: string; parent: TreeNode; }[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: { name: string; parent: TreeNode; }, index: number, array: { name: string; parent: TreeNode; }[]) => U, thisArg?: any): U[]; } >nodes : { name: string; parent: TreeNode; }[] ->map : (callbackfn: (value: { name: string; parent: TreeNode; }, index: number, array: { name: string; parent: TreeNode; }[]) => U, thisArg?: any) => U[] +>map : { (this: [{ name: string; parent: TreeNode; }, { name: string; parent: TreeNode; }, { name: string; parent: TreeNode; }, { name: string; parent: TreeNode; }, { name: string; parent: TreeNode; }], callbackfn: (value: { name: string; parent: TreeNode; }, index: number, array: { name: string; parent: TreeNode; }[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [{ name: string; parent: TreeNode; }, { name: string; parent: TreeNode; }, { name: string; parent: TreeNode; }, { name: string; parent: TreeNode; }], callbackfn: (value: { name: string; parent: TreeNode; }, index: number, array: { name: string; parent: TreeNode; }[]) => U, thisArg?: any): [U, U, U, U]; (this: [{ name: string; parent: TreeNode; }, { name: string; parent: TreeNode; }, { name: string; parent: TreeNode; }], callbackfn: (value: { name: string; parent: TreeNode; }, index: number, array: { name: string; parent: TreeNode; }[]) => U, thisArg?: any): [U, U, U]; (this: [{ name: string; parent: TreeNode; }, { name: string; parent: TreeNode; }], callbackfn: (value: { name: string; parent: TreeNode; }, index: number, array: { name: string; parent: TreeNode; }[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: { name: string; parent: TreeNode; }, index: number, array: { name: string; parent: TreeNode; }[]) => U, thisArg?: any): U[]; } >n => n.name : (n: { name: string; parent: TreeNode; }) => string >n : { name: string; parent: TreeNode; } >n.name : string From e4e11021985fcc9e7f86b02f9949cb829f7c9d4b Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 29 Sep 2016 15:24:23 -0700 Subject: [PATCH 5/5] Fixed fourslash test. --- tests/cases/fourslash/completionEntryForUnionMethod.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/cases/fourslash/completionEntryForUnionMethod.ts b/tests/cases/fourslash/completionEntryForUnionMethod.ts index f8b5b42f2a5be..dd0e034cd2daf 100644 --- a/tests/cases/fourslash/completionEntryForUnionMethod.ts +++ b/tests/cases/fourslash/completionEntryForUnionMethod.ts @@ -5,6 +5,7 @@ goTo.marker(); verify.quickInfoIs( - "(property) map: ((callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[]) | ((callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[])", - "Calls a defined callback function on each element of an array, and returns an array that contains the results."); -verify.completionListContains('map', "(property) map: ((callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[]) | ((callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[])"); \ No newline at end of file + "(property) map: {\n (this: [string, string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U, U];\n (this: [string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U];\n (this: [string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U];\n (this: [string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U];\n (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): U[];\n} | {\n (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U, U];\n (this: [number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U];\n (this: [number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U];\n (this: [number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U];\n (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): U[];\n}", + "Calls a defined callback function on each element of an array, and returns an array that contains the results.\nCalls a defined callback function on each element of an array, and returns an array that contains the results.\nCalls a defined callback function on each element of an array, and returns an array that contains the results.\nCalls a defined callback function on each element of an array, and returns an array that contains the results.\nCalls a defined callback function on each element of an array, and returns an array that contains the results."); + +verify.completionListContains('map', "(property) map: {\n (this: [string, string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U, U];\n (this: [string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U];\n (this: [string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U];\n (this: [string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U];\n (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): U[];\n} | {\n (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U, U];\n (this: [number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U];\n (this: [number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U];\n (this: [number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U];\n (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): U[];\n}");