diff --git a/src/lib/es2015.promise.d.ts b/src/lib/es2015.promise.d.ts index ab33531191ffc..b19a2d4771a21 100644 --- a/src/lib/es2015.promise.d.ts +++ b/src/lib/es2015.promise.d.ts @@ -10,7 +10,8 @@ interface PromiseConstructor { * a resolve callback used resolve the promise with a value or the result of another promise, * and a reject callback used to reject the promise with a provided reason or error. */ - new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void): Promise; + new (executor: (resolve: (value?: void | PromiseLike) => void, reject: (reason?: any) => void) => void): Promise; + new (executor: (resolve: (value: T | PromiseLike) => void, reject: (reason?: any) => void) => void): Promise; /** * Creates a Promise that is resolved with an array of results when all of the provided Promises diff --git a/tests/baselines/reference/asyncArrowFunction5_es2017.errors.txt b/tests/baselines/reference/asyncArrowFunction5_es2017.errors.txt index 594786d3005d4..f3d1ec8bd52b4 100644 --- a/tests/baselines/reference/asyncArrowFunction5_es2017.errors.txt +++ b/tests/baselines/reference/asyncArrowFunction5_es2017.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction5_es2017.ts(1,11): error TS2304: Cannot find name 'async'. tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction5_es2017.ts(1,18): error TS2304: Cannot find name 'await'. tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction5_es2017.ts(1,24): error TS1005: ',' expected. -tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction5_es2017.ts(1,26): error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 222:12, but here has type 'void'. +tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction5_es2017.ts(1,26): error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 223:12, but here has type 'void'. tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction5_es2017.ts(1,33): error TS1005: '=' expected. tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction5_es2017.ts(1,40): error TS1109: Expression expected. @@ -15,7 +15,7 @@ tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction5_es20 ~ !!! error TS1005: ',' expected. ~~~~~~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 222:12, but here has type 'void'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 223:12, but here has type 'void'. ~ !!! error TS1005: '=' expected. ~~ diff --git a/tests/baselines/reference/asyncArrowFunction5_es5.errors.txt b/tests/baselines/reference/asyncArrowFunction5_es5.errors.txt index 949e2401d3513..0429c952d1c5f 100644 --- a/tests/baselines/reference/asyncArrowFunction5_es5.errors.txt +++ b/tests/baselines/reference/asyncArrowFunction5_es5.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction5_es5.ts(1,11): error TS2304: Cannot find name 'async'. tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction5_es5.ts(1,18): error TS2304: Cannot find name 'await'. tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction5_es5.ts(1,24): error TS1005: ',' expected. -tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction5_es5.ts(1,26): error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 222:12, but here has type 'void'. +tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction5_es5.ts(1,26): error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 223:12, but here has type 'void'. tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction5_es5.ts(1,33): error TS1005: '=' expected. tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction5_es5.ts(1,40): error TS1109: Expression expected. @@ -15,7 +15,7 @@ tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction5_es5.ts( ~ !!! error TS1005: ',' expected. ~~~~~~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 222:12, but here has type 'void'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 223:12, but here has type 'void'. ~ !!! error TS1005: '=' expected. ~~ diff --git a/tests/baselines/reference/asyncArrowFunction5_es6.errors.txt b/tests/baselines/reference/asyncArrowFunction5_es6.errors.txt index b3cb60c95ca4a..ae41c7079d018 100644 --- a/tests/baselines/reference/asyncArrowFunction5_es6.errors.txt +++ b/tests/baselines/reference/asyncArrowFunction5_es6.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction5_es6.ts(1,11): error TS2304: Cannot find name 'async'. tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction5_es6.ts(1,18): error TS2304: Cannot find name 'await'. tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction5_es6.ts(1,24): error TS1005: ',' expected. -tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction5_es6.ts(1,26): error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 222:12, but here has type 'void'. +tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction5_es6.ts(1,26): error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 223:12, but here has type 'void'. tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction5_es6.ts(1,33): error TS1005: '=' expected. tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction5_es6.ts(1,40): error TS1109: Expression expected. @@ -15,7 +15,7 @@ tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction5_es6.ts( ~ !!! error TS1005: ',' expected. ~~~~~~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 222:12, but here has type 'void'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 223:12, but here has type 'void'. ~ !!! error TS1005: '=' expected. ~~ diff --git a/tests/baselines/reference/asyncArrowFunction9_es2017.errors.txt b/tests/baselines/reference/asyncArrowFunction9_es2017.errors.txt index c888995f1fb2d..1951769465ca5 100644 --- a/tests/baselines/reference/asyncArrowFunction9_es2017.errors.txt +++ b/tests/baselines/reference/asyncArrowFunction9_es2017.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction9_es2017.ts(1,11): error TS2304: Cannot find name 'async'. tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction9_es2017.ts(1,18): error TS2304: Cannot find name 'a'. tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction9_es2017.ts(1,37): error TS1005: ',' expected. -tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction9_es2017.ts(1,39): error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 222:12, but here has type 'void'. +tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction9_es2017.ts(1,39): error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 223:12, but here has type 'void'. tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction9_es2017.ts(1,46): error TS1005: '=' expected. tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction9_es2017.ts(1,53): error TS1109: Expression expected. @@ -15,7 +15,7 @@ tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction9_es20 ~ !!! error TS1005: ',' expected. ~~~~~~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 222:12, but here has type 'void'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 223:12, but here has type 'void'. ~ !!! error TS1005: '=' expected. ~~ diff --git a/tests/baselines/reference/asyncArrowFunction9_es5.errors.txt b/tests/baselines/reference/asyncArrowFunction9_es5.errors.txt index e215259245eb4..916f09bcf70cc 100644 --- a/tests/baselines/reference/asyncArrowFunction9_es5.errors.txt +++ b/tests/baselines/reference/asyncArrowFunction9_es5.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction9_es5.ts(1,11): error TS2304: Cannot find name 'async'. tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction9_es5.ts(1,18): error TS2304: Cannot find name 'a'. tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction9_es5.ts(1,37): error TS1005: ',' expected. -tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction9_es5.ts(1,39): error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 222:12, but here has type 'void'. +tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction9_es5.ts(1,39): error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 223:12, but here has type 'void'. tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction9_es5.ts(1,46): error TS1005: '=' expected. tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction9_es5.ts(1,53): error TS1109: Expression expected. @@ -15,7 +15,7 @@ tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction9_es5.ts( ~ !!! error TS1005: ',' expected. ~~~~~~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 222:12, but here has type 'void'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 223:12, but here has type 'void'. ~ !!! error TS1005: '=' expected. ~~ diff --git a/tests/baselines/reference/asyncArrowFunction9_es6.errors.txt b/tests/baselines/reference/asyncArrowFunction9_es6.errors.txt index 8d974d75dd330..bfd0223ca6b56 100644 --- a/tests/baselines/reference/asyncArrowFunction9_es6.errors.txt +++ b/tests/baselines/reference/asyncArrowFunction9_es6.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction9_es6.ts(1,11): error TS2304: Cannot find name 'async'. tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction9_es6.ts(1,18): error TS2304: Cannot find name 'a'. tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction9_es6.ts(1,37): error TS1005: ',' expected. -tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction9_es6.ts(1,39): error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 222:12, but here has type 'void'. +tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction9_es6.ts(1,39): error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 223:12, but here has type 'void'. tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction9_es6.ts(1,46): error TS1005: '=' expected. tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction9_es6.ts(1,53): error TS1109: Expression expected. @@ -15,7 +15,7 @@ tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction9_es6.ts( ~ !!! error TS1005: ',' expected. ~~~~~~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 222:12, but here has type 'void'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 223:12, but here has type 'void'. ~ !!! error TS1005: '=' expected. ~~ diff --git a/tests/baselines/reference/defaultExportInAwaitExpression01.js b/tests/baselines/reference/defaultExportInAwaitExpression01.js index 6a31461fe3cf2..bb2b340237572 100644 --- a/tests/baselines/reference/defaultExportInAwaitExpression01.js +++ b/tests/baselines/reference/defaultExportInAwaitExpression01.js @@ -1,7 +1,7 @@ //// [tests/cases/conformance/es6/modules/defaultExportInAwaitExpression01.ts] //// //// [a.ts] -const x = new Promise( ( resolve, reject ) => { resolve( {} ); } ); +const x = new Promise<{}>( ( resolve, reject ) => { resolve( {} ); } ); export default x; //// [b.ts] diff --git a/tests/baselines/reference/defaultExportInAwaitExpression01.symbols b/tests/baselines/reference/defaultExportInAwaitExpression01.symbols index 2741f624cff07..b6af36feaa595 100644 --- a/tests/baselines/reference/defaultExportInAwaitExpression01.symbols +++ b/tests/baselines/reference/defaultExportInAwaitExpression01.symbols @@ -1,10 +1,10 @@ === tests/cases/conformance/es6/modules/a.ts === -const x = new Promise( ( resolve, reject ) => { resolve( {} ); } ); +const x = new Promise<{}>( ( resolve, reject ) => { resolve( {} ); } ); >x : Symbol(x, Decl(a.ts, 0, 5)) >Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->resolve : Symbol(resolve, Decl(a.ts, 0, 24)) ->reject : Symbol(reject, Decl(a.ts, 0, 33)) ->resolve : Symbol(resolve, Decl(a.ts, 0, 24)) +>resolve : Symbol(resolve, Decl(a.ts, 0, 28)) +>reject : Symbol(reject, Decl(a.ts, 0, 37)) +>resolve : Symbol(resolve, Decl(a.ts, 0, 28)) export default x; >x : Symbol(x, Decl(a.ts, 0, 5)) diff --git a/tests/baselines/reference/defaultExportInAwaitExpression01.types b/tests/baselines/reference/defaultExportInAwaitExpression01.types index 1f7de76b90eae..12479810b1678 100644 --- a/tests/baselines/reference/defaultExportInAwaitExpression01.types +++ b/tests/baselines/reference/defaultExportInAwaitExpression01.types @@ -1,13 +1,13 @@ === tests/cases/conformance/es6/modules/a.ts === -const x = new Promise( ( resolve, reject ) => { resolve( {} ); } ); +const x = new Promise<{}>( ( resolve, reject ) => { resolve( {} ); } ); >x : Promise<{}> ->new Promise( ( resolve, reject ) => { resolve( {} ); } ) : Promise<{}> +>new Promise<{}>( ( resolve, reject ) => { resolve( {} ); } ) : Promise<{}> >Promise : PromiseConstructor ->( resolve, reject ) => { resolve( {} ); } : (resolve: (value?: {} | PromiseLike<{}>) => void, reject: (reason?: any) => void) => void ->resolve : (value?: {} | PromiseLike<{}>) => void +>( resolve, reject ) => { resolve( {} ); } : (resolve: (value: {} | PromiseLike<{}>) => void, reject: (reason?: any) => void) => void +>resolve : (value: {} | PromiseLike<{}>) => void >reject : (reason?: any) => void >resolve( {} ) : void ->resolve : (value?: {} | PromiseLike<{}>) => void +>resolve : (value: {} | PromiseLike<{}>) => void >{} : {} export default x; diff --git a/tests/baselines/reference/defaultExportInAwaitExpression02.js b/tests/baselines/reference/defaultExportInAwaitExpression02.js index 565cfb416175c..c06397c8392bb 100644 --- a/tests/baselines/reference/defaultExportInAwaitExpression02.js +++ b/tests/baselines/reference/defaultExportInAwaitExpression02.js @@ -1,7 +1,7 @@ //// [tests/cases/conformance/es6/modules/defaultExportInAwaitExpression02.ts] //// //// [a.ts] -const x = new Promise( ( resolve, reject ) => { resolve( {} ); } ); +const x = new Promise<{}>( ( resolve, reject ) => { resolve( {} ); } ); export default x; //// [b.ts] diff --git a/tests/baselines/reference/defaultExportInAwaitExpression02.symbols b/tests/baselines/reference/defaultExportInAwaitExpression02.symbols index 2741f624cff07..b6af36feaa595 100644 --- a/tests/baselines/reference/defaultExportInAwaitExpression02.symbols +++ b/tests/baselines/reference/defaultExportInAwaitExpression02.symbols @@ -1,10 +1,10 @@ === tests/cases/conformance/es6/modules/a.ts === -const x = new Promise( ( resolve, reject ) => { resolve( {} ); } ); +const x = new Promise<{}>( ( resolve, reject ) => { resolve( {} ); } ); >x : Symbol(x, Decl(a.ts, 0, 5)) >Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->resolve : Symbol(resolve, Decl(a.ts, 0, 24)) ->reject : Symbol(reject, Decl(a.ts, 0, 33)) ->resolve : Symbol(resolve, Decl(a.ts, 0, 24)) +>resolve : Symbol(resolve, Decl(a.ts, 0, 28)) +>reject : Symbol(reject, Decl(a.ts, 0, 37)) +>resolve : Symbol(resolve, Decl(a.ts, 0, 28)) export default x; >x : Symbol(x, Decl(a.ts, 0, 5)) diff --git a/tests/baselines/reference/defaultExportInAwaitExpression02.types b/tests/baselines/reference/defaultExportInAwaitExpression02.types index 1f7de76b90eae..12479810b1678 100644 --- a/tests/baselines/reference/defaultExportInAwaitExpression02.types +++ b/tests/baselines/reference/defaultExportInAwaitExpression02.types @@ -1,13 +1,13 @@ === tests/cases/conformance/es6/modules/a.ts === -const x = new Promise( ( resolve, reject ) => { resolve( {} ); } ); +const x = new Promise<{}>( ( resolve, reject ) => { resolve( {} ); } ); >x : Promise<{}> ->new Promise( ( resolve, reject ) => { resolve( {} ); } ) : Promise<{}> +>new Promise<{}>( ( resolve, reject ) => { resolve( {} ); } ) : Promise<{}> >Promise : PromiseConstructor ->( resolve, reject ) => { resolve( {} ); } : (resolve: (value?: {} | PromiseLike<{}>) => void, reject: (reason?: any) => void) => void ->resolve : (value?: {} | PromiseLike<{}>) => void +>( resolve, reject ) => { resolve( {} ); } : (resolve: (value: {} | PromiseLike<{}>) => void, reject: (reason?: any) => void) => void +>resolve : (value: {} | PromiseLike<{}>) => void >reject : (reason?: any) => void >resolve( {} ) : void ->resolve : (value?: {} | PromiseLike<{}>) => void +>resolve : (value: {} | PromiseLike<{}>) => void >{} : {} export default x; diff --git a/tests/baselines/reference/inferenceLimit.js b/tests/baselines/reference/inferenceLimit.js index 997cbcd5b791b..5b25e60ed6120 100644 --- a/tests/baselines/reference/inferenceLimit.js +++ b/tests/baselines/reference/inferenceLimit.js @@ -14,7 +14,7 @@ export class BrokenClass { let result: Array = []; let populateItems = (order) => { - return new Promise((resolve, reject) => { + return new Promise<{}>((resolve, reject) => { this.doStuff(order.id) .then((items) => { order.items = items; diff --git a/tests/baselines/reference/inferenceLimit.symbols b/tests/baselines/reference/inferenceLimit.symbols index 1ae8ca5f1df6c..53ce0fc7f2a7d 100644 --- a/tests/baselines/reference/inferenceLimit.symbols +++ b/tests/baselines/reference/inferenceLimit.symbols @@ -31,10 +31,10 @@ export class BrokenClass { >populateItems : Symbol(populateItems, Decl(file1.ts, 12, 7)) >order : Symbol(order, Decl(file1.ts, 12, 25)) - return new Promise((resolve, reject) => { + return new Promise<{}>((resolve, reject) => { >Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->resolve : Symbol(resolve, Decl(file1.ts, 13, 26)) ->reject : Symbol(reject, Decl(file1.ts, 13, 34)) +>resolve : Symbol(resolve, Decl(file1.ts, 13, 30)) +>reject : Symbol(reject, Decl(file1.ts, 13, 38)) this.doStuff(order.id) >this.doStuff(order.id) .then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) @@ -52,7 +52,7 @@ export class BrokenClass { >items : Symbol(items, Decl(file1.ts, 15, 17)) resolve(order); ->resolve : Symbol(resolve, Decl(file1.ts, 13, 26)) +>resolve : Symbol(resolve, Decl(file1.ts, 13, 30)) >order : Symbol(order, Decl(file1.ts, 12, 25)) }); diff --git a/tests/baselines/reference/inferenceLimit.types b/tests/baselines/reference/inferenceLimit.types index 4a3989322322b..22b35cc908c5c 100644 --- a/tests/baselines/reference/inferenceLimit.types +++ b/tests/baselines/reference/inferenceLimit.types @@ -16,13 +16,13 @@ export class BrokenClass { >value : string return new Promise>((resolve, reject) => { ->new Promise>((resolve, reject) => { let result: Array = []; let populateItems = (order) => { return new Promise((resolve, reject) => { this.doStuff(order.id) .then((items) => { order.items = items; resolve(order); }); }); }; return Promise.all(result.map(populateItems)) .then((orders: Array) => { resolve(orders); }); }) : Promise +>new Promise>((resolve, reject) => { let result: Array = []; let populateItems = (order) => { return new Promise<{}>((resolve, reject) => { this.doStuff(order.id) .then((items) => { order.items = items; resolve(order); }); }); }; return Promise.all(result.map(populateItems)) .then((orders: Array) => { resolve(orders); }); }) : Promise >Promise : PromiseConstructor >Array : T[] >MyModule : any >MyModel : MyModule.MyModel ->(resolve, reject) => { let result: Array = []; let populateItems = (order) => { return new Promise((resolve, reject) => { this.doStuff(order.id) .then((items) => { order.items = items; resolve(order); }); }); }; return Promise.all(result.map(populateItems)) .then((orders: Array) => { resolve(orders); }); } : (resolve: (value?: MyModule.MyModel[] | PromiseLike) => void, reject: (reason?: any) => void) => Promise ->resolve : (value?: MyModule.MyModel[] | PromiseLike) => void +>(resolve, reject) => { let result: Array = []; let populateItems = (order) => { return new Promise<{}>((resolve, reject) => { this.doStuff(order.id) .then((items) => { order.items = items; resolve(order); }); }); }; return Promise.all(result.map(populateItems)) .then((orders: Array) => { resolve(orders); }); } : (resolve: (value: MyModule.MyModel[] | PromiseLike) => void, reject: (reason?: any) => void) => Promise +>resolve : (value: MyModule.MyModel[] | PromiseLike) => void >reject : (reason?: any) => void let result: Array = []; @@ -34,14 +34,14 @@ export class BrokenClass { let populateItems = (order) => { >populateItems : (order: any) => Promise<{}> ->(order) => { return new Promise((resolve, reject) => { this.doStuff(order.id) .then((items) => { order.items = items; resolve(order); }); }); } : (order: any) => Promise<{}> +>(order) => { return new Promise<{}>((resolve, reject) => { this.doStuff(order.id) .then((items) => { order.items = items; resolve(order); }); }); } : (order: any) => Promise<{}> >order : any - return new Promise((resolve, reject) => { ->new Promise((resolve, reject) => { this.doStuff(order.id) .then((items) => { order.items = items; resolve(order); }); }) : Promise<{}> + return new Promise<{}>((resolve, reject) => { +>new Promise<{}>((resolve, reject) => { this.doStuff(order.id) .then((items) => { order.items = items; resolve(order); }); }) : Promise<{}> >Promise : PromiseConstructor ->(resolve, reject) => { this.doStuff(order.id) .then((items) => { order.items = items; resolve(order); }); } : (resolve: (value?: {} | PromiseLike<{}>) => void, reject: (reason?: any) => void) => void ->resolve : (value?: {} | PromiseLike<{}>) => void +>(resolve, reject) => { this.doStuff(order.id) .then((items) => { order.items = items; resolve(order); }); } : (resolve: (value: {} | PromiseLike<{}>) => void, reject: (reason?: any) => void) => void +>resolve : (value: {} | PromiseLike<{}>) => void >reject : (reason?: any) => void this.doStuff(order.id) @@ -69,7 +69,7 @@ export class BrokenClass { resolve(order); >resolve(order) : void ->resolve : (value?: {} | PromiseLike<{}>) => void +>resolve : (value: {} | PromiseLike<{}>) => void >order : any }); @@ -99,7 +99,7 @@ export class BrokenClass { resolve(orders); >resolve(orders) : void ->resolve : (value?: MyModule.MyModel[] | PromiseLike) => void +>resolve : (value: MyModule.MyModel[] | PromiseLike) => void >orders : MyModule.MyModel[] }); diff --git a/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions1.types b/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions1.types index 4743391fcf194..01a5a9212f567 100644 --- a/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions1.types +++ b/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions1.types @@ -132,13 +132,13 @@ o.hasOwnProperty(Symbol.hasInstance); // Using ES6 promise async function out() { ->out : () => Promise<{}> +>out : () => Promise return new Promise(function (resolve, reject) {}); ->new Promise(function (resolve, reject) {}) : Promise<{}> +>new Promise(function (resolve, reject) {}) : Promise >Promise : PromiseConstructor ->function (resolve, reject) {} : (resolve: (value?: {} | PromiseLike<{}>) => void, reject: (reason?: any) => void) => void ->resolve : (value?: {} | PromiseLike<{}>) => void +>function (resolve, reject) {} : (resolve: (value?: void | PromiseLike) => void, reject: (reason?: any) => void) => void +>resolve : (value?: void | PromiseLike) => void >reject : (reason?: any) => void } @@ -147,10 +147,10 @@ declare var console: any; out().then(() => { >out().then(() => { console.log("Yea!");}) : Promise ->out().then : (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise ->out() : Promise<{}> ->out : () => Promise<{}> ->then : (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>out().then : (onfulfilled?: (value: void) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>out() : Promise +>out : () => Promise +>then : (onfulfilled?: (value: void) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => { console.log("Yea!");} : () => void console.log("Yea!"); diff --git a/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions2.types b/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions2.types index a700c1c03f6c5..6c39fbb20f065 100644 --- a/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions2.types +++ b/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions2.types @@ -132,13 +132,13 @@ o.hasOwnProperty(Symbol.hasInstance); // Using ES6 promise async function out() { ->out : () => Promise<{}> +>out : () => Promise return new Promise(function (resolve, reject) {}); ->new Promise(function (resolve, reject) {}) : Promise<{}> +>new Promise(function (resolve, reject) {}) : Promise >Promise : PromiseConstructor ->function (resolve, reject) {} : (resolve: (value?: {} | PromiseLike<{}>) => void, reject: (reason?: any) => void) => void ->resolve : (value?: {} | PromiseLike<{}>) => void +>function (resolve, reject) {} : (resolve: (value?: void | PromiseLike) => void, reject: (reason?: any) => void) => void +>resolve : (value?: void | PromiseLike) => void >reject : (reason?: any) => void } @@ -147,10 +147,10 @@ declare var console: any; out().then(() => { >out().then(() => { console.log("Yea!");}) : Promise ->out().then : (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise ->out() : Promise<{}> ->out : () => Promise<{}> ->then : (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>out().then : (onfulfilled?: (value: void) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>out() : Promise +>out : () => Promise +>then : (onfulfilled?: (value: void) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => { console.log("Yea!");} : () => void console.log("Yea!"); diff --git a/tests/baselines/reference/modularizeLibrary_TargetES5UsingES6Lib.types b/tests/baselines/reference/modularizeLibrary_TargetES5UsingES6Lib.types index d51e87c8b9d97..c1d6c25d7b571 100644 --- a/tests/baselines/reference/modularizeLibrary_TargetES5UsingES6Lib.types +++ b/tests/baselines/reference/modularizeLibrary_TargetES5UsingES6Lib.types @@ -132,13 +132,13 @@ o.hasOwnProperty(Symbol.hasInstance); // Using ES6 promise async function out() { ->out : () => Promise<{}> +>out : () => Promise return new Promise(function (resolve, reject) {}); ->new Promise(function (resolve, reject) {}) : Promise<{}> +>new Promise(function (resolve, reject) {}) : Promise >Promise : PromiseConstructor ->function (resolve, reject) {} : (resolve: (value?: {} | PromiseLike<{}>) => void, reject: (reason?: any) => void) => void ->resolve : (value?: {} | PromiseLike<{}>) => void +>function (resolve, reject) {} : (resolve: (value?: void | PromiseLike) => void, reject: (reason?: any) => void) => void +>resolve : (value?: void | PromiseLike) => void >reject : (reason?: any) => void } @@ -147,10 +147,10 @@ declare var console: any; out().then(() => { >out().then(() => { console.log("Yea!");}) : Promise ->out().then : (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise ->out() : Promise<{}> ->out : () => Promise<{}> ->then : (onfulfilled?: (value: {}) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>out().then : (onfulfilled?: (value: void) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise +>out() : Promise +>out : () => Promise +>then : (onfulfilled?: (value: void) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >() => { console.log("Yea!");} : () => void console.log("Yea!"); diff --git a/tests/cases/compiler/inferenceLimit.ts b/tests/cases/compiler/inferenceLimit.ts index adaf13bad2225..d0543fba677cf 100644 --- a/tests/cases/compiler/inferenceLimit.ts +++ b/tests/cases/compiler/inferenceLimit.ts @@ -14,7 +14,7 @@ export class BrokenClass { let result: Array = []; let populateItems = (order) => { - return new Promise((resolve, reject) => { + return new Promise<{}>((resolve, reject) => { this.doStuff(order.id) .then((items) => { order.items = items; diff --git a/tests/cases/conformance/es6/modules/defaultExportInAwaitExpression01.ts b/tests/cases/conformance/es6/modules/defaultExportInAwaitExpression01.ts index 45f1542301663..54be7f1524c67 100644 --- a/tests/cases/conformance/es6/modules/defaultExportInAwaitExpression01.ts +++ b/tests/cases/conformance/es6/modules/defaultExportInAwaitExpression01.ts @@ -1,7 +1,7 @@ // @target: ES6 // @module: umd // @filename: a.ts -const x = new Promise( ( resolve, reject ) => { resolve( {} ); } ); +const x = new Promise<{}>( ( resolve, reject ) => { resolve( {} ); } ); export default x; // @filename: b.ts diff --git a/tests/cases/conformance/es6/modules/defaultExportInAwaitExpression02.ts b/tests/cases/conformance/es6/modules/defaultExportInAwaitExpression02.ts index cd878540a3c64..079cc93779c0d 100644 --- a/tests/cases/conformance/es6/modules/defaultExportInAwaitExpression02.ts +++ b/tests/cases/conformance/es6/modules/defaultExportInAwaitExpression02.ts @@ -1,7 +1,7 @@ // @target: ES6 // @module: commonjs // @filename: a.ts -const x = new Promise( ( resolve, reject ) => { resolve( {} ); } ); +const x = new Promise<{}>( ( resolve, reject ) => { resolve( {} ); } ); export default x; // @filename: b.ts