/third_party/typescript/tests/baselines/reference/ |
D | bluebirdStaticThis.types | 6 export declare class Promise<R> implements Promise.Thenable<R> { 7 >Promise : Promise<R> 8 >Promise : typeof Promise 10 …constructor(callback: (resolve: (thenableOrResult: R | Promise.Thenable<R>) => void, reject: (erro… 11 >callback : (resolve: (thenableOrResult: R | Promise.Thenable<R>) => void, reject: (error: any) => … 12 >resolve : (thenableOrResult: R | Promise.Thenable<R>) => void 13 >thenableOrResult : R | Promise.Thenable<R> 14 >Promise : any 18 …static try<R>(dit: typeof Promise, fn: () => Promise.Thenable<R>, args?: any[], ctx?: any): Promis… 19 …f Promise, fn: () => Promise.Thenable<R>, args?: any[], ctx?: any): Promise<R>; <R>(dit: typeof Pr… [all …]
|
D | es5-asyncFunctionLongObjectLiteral.types | 5 >fooShort : () => Promise<{ a: number; b: number; c: number; d: number; e: number; }> 6 …Promise.resolve(0), b: await Promise.resolve(1), c: await Promise.resolve(2), … 9 … Promise.resolve(0), b: await Promise.resolve(1), c: await Promise.resolve(2), … 11 a: await Promise.resolve(0), 13 >await Promise.resolve(0) : number 14 >Promise.resolve(0) : Promise<number> 15 >Promise.resolve : { (): Promise<void>; <T>(value: T): Promise<Awaited<T>>; <T>(value: T | PromiseL… 16 >Promise : PromiseConstructor 17 >resolve : { (): Promise<void>; <T>(value: T): Promise<Awaited<T>>; <T>(value: T | PromiseLike<T>):… 20 b: await Promise.resolve(1), [all …]
|
D | bluebirdStaticThis.js | 6 export declare class Promise<R> implements Promise.Thenable<R> { 7 …constructor(callback: (resolve: (thenableOrResult: R | Promise.Thenable<R>) => void, reject: (erro… 8 …static try<R>(dit: typeof Promise, fn: () => Promise.Thenable<R>, args?: any[], ctx?: any): Promis… 9 static try<R>(dit: typeof Promise, fn: () => R, args?: any[], ctx?: any): Promise<R>; 11 …static attempt<R>(dit: typeof Promise, fn: () => Promise.Thenable<R>, args?: any[], ctx?: any): Pr… 12 static attempt<R>(dit: typeof Promise, fn: () => R, args?: any[], ctx?: any): Promise<R>; 14 static method(dit: typeof Promise, fn: Function): Function; 16 static resolve(dit: typeof Promise): Promise<void>; 17 static resolve<R>(dit: typeof Promise, value: Promise.Thenable<R>): Promise<R>; 18 static resolve<R>(dit: typeof Promise, value: R): Promise<R>; [all …]
|
D | genericCallToOverloadedMethodWithOverloadedArguments.types | 5 interface Promise<T> { 6 then<U>(cb: (x: T) => Promise<U>): Promise<U>; 7 >then : <U>(cb: (x: T) => Promise<U>) => Promise<U> 8 >cb : (x: T) => Promise<U> 12 declare function testFunction(n: number): Promise<number>; 13 >testFunction : (n: number) => Promise<number> 16 var numPromise: Promise<number>; 17 >numPromise : Promise<number> 20 >newPromise : Promise<number> 21 >numPromise.then(testFunction) : Promise<number> [all …]
|
D | bluebirdStaticThis.errors.txt | 1 tests/cases/compiler/bluebirdStaticThis.ts(5,22): error TS2420: Class 'Promise<R>' incorrectly impl… 2 Property 'then' is missing in type 'Promise<R>' but required in type 'Thenable<R>'. 3 …,51): error TS2694: Namespace '"tests/cases/compiler/bluebirdStaticThis".Promise' has no exported … 4 …109): error TS2694: Namespace '"tests/cases/compiler/bluebirdStaticThis".Promise' has no exported … 5 …,91): error TS2694: Namespace '"tests/cases/compiler/bluebirdStaticThis".Promise' has no exported … 6 …,91): error TS2694: Namespace '"tests/cases/compiler/bluebirdStaticThis".Promise' has no exported … 7 …,73): error TS2694: Namespace '"tests/cases/compiler/bluebirdStaticThis".Promise' has no exported … 15 export declare class Promise<R> implements Promise.Thenable<R> { 17 !!! error TS2420: Class 'Promise<R>' incorrectly implements interface 'Thenable<R>'. 18 !!! error TS2420: Property 'then' is missing in type 'Promise<R>' but required in type 'Thenable<… [all …]
|
D | promiseType.types | 2 declare var p: Promise<boolean>; 3 >p : Promise<boolean> 9 >A : () => Promise<boolean> 14 >p : Promise<boolean> 21 >B : () => Promise<number> 26 >p : Promise<boolean> 33 >C : () => Promise<1 | "error"> 39 >p : Promise<boolean> 53 >D : () => Promise<number> 59 >p : Promise<boolean> [all …]
|
D | types.asyncGenerators.es2018.1.types | 21 yield Promise.resolve(1); 22 >yield Promise.resolve(1) : any 23 >Promise.resolve(1) : Promise<number> 24 >Promise.resolve : { (): Promise<void>; <T>(value: T): Promise<Awaited<T>>; <T>(value: T | PromiseL… 25 >Promise : PromiseConstructor 26 >resolve : { (): Promise<void>; <T>(value: T): Promise<Awaited<T>>; <T>(value: T | PromiseLike<T>):… 36 yield Promise.resolve(2); 37 >yield Promise.resolve(2) : any 38 >Promise.resolve(2) : Promise<number> 39 >Promise.resolve : { (): Promise<void>; <T>(value: T): Promise<Awaited<T>>; <T>(value: T | PromiseL… [all …]
|
D | genericCallToOverloadedMethodWithOverloadedArguments.errors.txt | 1 …ype '{ (n: number): Promise<number>; (s: string): Promise<string>; }' is not assignable to paramet… 2 Type 'Promise<number>' is not assignable to type 'Promise<string>'. 5 …Overload 1 of 2, '(cb: (x: number) => Promise<string>): Promise<string>', gave the following error. 6 …ype '{ (n: number): Promise<number>; (s: string): Promise<string>; }' is not assignable to paramet… 7 Type 'Promise<number>' is not assignable to type 'Promise<string>'. 9 …Overload 2 of 2, '(cb: (x: number) => Promise<string>, error?: (error: any) => Promise<string>): P… 10 …ype '{ (n: number): Promise<number>; (s: string): Promise<string>; }' is not assignable to paramet… 11 Type 'Promise<number>' is not assignable to type 'Promise<string>'. 13 …Overload 1 of 3, '(cb: (x: number) => Promise<string>): Promise<string>', gave the following error. 14 …ype '{ (n: number): Promise<number>; (s: string): Promise<string>; }' is not assignable to paramet… [all …]
|
D | asyncFunctionReturnType.types | 3 >fAsync : () => Promise<(number | boolean)[]> 12 async function fAsyncExplicit(): Promise<[number, boolean]> { 13 >fAsyncExplicit : () => Promise<[number, boolean]> 31 async function fIndexedTypeForStringProp(obj: Obj): Promise<Obj["stringProp"]> { 32 >fIndexedTypeForStringProp : (obj: Obj) => Promise<Obj["stringProp"]> 41 async function fIndexedTypeForPromiseOfStringProp(obj: Obj): Promise<Obj["stringProp"]> { 42 >fIndexedTypeForPromiseOfStringProp : (obj: Obj) => Promise<Obj["stringProp"]> 45 return Promise.resolve(obj.stringProp); 46 >Promise.resolve(obj.stringProp) : Promise<string> 47 >Promise.resolve : { (): Promise<void>; <T>(value: T): Promise<Awaited<T>>; <T>(value: T | PromiseL… [all …]
|
D | promiseTypeStrictNull.types | 2 declare var p: Promise<boolean>; 3 >p : Promise<boolean> 9 >A : () => Promise<boolean> 14 >p : Promise<boolean> 21 >B : () => Promise<number> 26 >p : Promise<boolean> 33 >C : () => Promise<1 | "error"> 39 >p : Promise<boolean> 53 >D : () => Promise<1 | undefined> 59 >p : Promise<boolean> [all …]
|
D | es2017basicAsync.types | 2 async (): Promise<void> => { 3 >async (): Promise<void> => { await 0;} : () => Promise<void> 11 >asyncFunc : () => Promise<void> 18 const asyncArrowFunc = async (): Promise<void> => { 19 >asyncArrowFunc : () => Promise<void> 20 >async (): Promise<void> => { await 0;} : () => Promise<void> 28 >asyncIIFE : () => Promise<void> 34 await (async function(): Promise<void> { 35 >await (async function(): Promise<void> { await 1; })() : void 36 >(async function(): Promise<void> { await 1; })() : Promise<void> [all …]
|
D | asyncFunctionContextuallyTypedReturns.types | 7 f(v => v ? [0] : Promise.reject()); 8 >f(v => v ? [0] : Promise.reject()) : void 10 >v => v ? [0] : Promise.reject() : (v: boolean) => [0] | Promise<[0]> 12 >v ? [0] : Promise.reject() : [0] | Promise<[0]> 16 >Promise.reject() : Promise<[0]> 17 >Promise.reject : <T = never>(reason?: any) => Promise<T> 18 >Promise : PromiseConstructor 19 >reject : <T = never>(reason?: any) => Promise<T> 21 f(async v => v ? [0] : Promise.reject()); 22 >f(async v => v ? [0] : Promise.reject()) : void [all …]
|
D | bluebirdStaticThis.symbols | 6 export declare class Promise<R> implements Promise.Thenable<R> { 7 >Promise : Symbol(Promise, Decl(bluebirdStaticThis.ts, 0, 0), Decl(bluebirdStaticThis.ts, 108, 1)) 9 >Promise.Thenable : Symbol(Promise.Thenable, Decl(bluebirdStaticThis.ts, 110, 31)) 10 >Promise : Symbol(Promise, Decl(bluebirdStaticThis.ts, 0, 0), Decl(bluebirdStaticThis.ts, 108, 1)) 11 >Thenable : Symbol(Promise.Thenable, Decl(bluebirdStaticThis.ts, 110, 31)) 14 …constructor(callback: (resolve: (thenableOrResult: R | Promise.Thenable<R>) => void, reject: (erro… 19 >Promise : Symbol(Promise, Decl(bluebirdStaticThis.ts, 0, 0), Decl(bluebirdStaticThis.ts, 108, 1)) 20 >Thenable : Symbol(Promise.Thenable, Decl(bluebirdStaticThis.ts, 110, 31)) 25 …static try<R>(dit: typeof Promise, fn: () => Promise.Thenable<R>, args?: any[], ctx?: any): Promis… 26 >try : Symbol(Promise.try, Decl(bluebirdStaticThis.ts, 5, 125), Decl(bluebirdStaticThis.ts, 6, 107)) [all …]
|
D | truthinessPromiseCoercion.types | 2 declare const p: Promise<number> 3 >p : Promise<number> 5 declare const p2: null | Promise<number> 6 >p2 : Promise<number> | null 9 declare const obj: { p: Promise<unknown> } 10 >obj : { p: Promise<unknown>; } 11 >p : Promise<unknown> 13 declare function pf(): Promise<boolean> 14 >pf : () => Promise<boolean> 17 >f : () => Promise<void> [all …]
|
D | operationsAvailableOnPromisedType.types | 3 …Promise<number>, c: Promise<string[]>, d: Promise<{ prop: string;}>, e: Promise<() => void>, f:… 8 b: Promise<number>, 9 >b : Promise<number> 11 c: Promise<string[]>, 12 >c : Promise<string[]> 14 d: Promise<{ prop: string }>, 15 >d : Promise<{ prop: string; }> 18 e: Promise<() => void>, 19 >e : Promise<() => void> 21 f: Promise<() => void> | (() => void), [all …]
|
D | genericCallToOverloadedMethodWithOverloadedArguments.symbols | 5 interface Promise<T> { 6 >Promise : Symbol(Promise, Decl(genericCallToOverloadedMethodWithOverloadedArguments.ts, 0, 11)) 9 then<U>(cb: (x: T) => Promise<U>): Promise<U>; 10 >then : Symbol(Promise.then, Decl(genericCallToOverloadedMethodWithOverloadedArguments.ts, 1, 26)) 15 >Promise : Symbol(Promise, Decl(genericCallToOverloadedMethodWithOverloadedArguments.ts, 0, 11)) 17 >Promise : Symbol(Promise, Decl(genericCallToOverloadedMethodWithOverloadedArguments.ts, 0, 11)) 21 declare function testFunction(n: number): Promise<number>; 24 >Promise : Symbol(Promise, Decl(genericCallToOverloadedMethodWithOverloadedArguments.ts, 0, 11)) 26 var numPromise: Promise<number>; 28 >Promise : Symbol(Promise, Decl(genericCallToOverloadedMethodWithOverloadedArguments.ts, 0, 11)) [all …]
|
D | genericCallToOverloadedMethodWithOverloadedArguments.js | 3 interface Promise<T> { 4 then<U>(cb: (x: T) => Promise<U>): Promise<U>; 7 declare function testFunction(n: number): Promise<number>; 9 var numPromise: Promise<number>; 16 interface Promise<T> { 17 then<U>(cb: (x: T) => Promise<U>): Promise<U>; 20 declare function testFunction(n: number): Promise<number>; 21 declare function testFunction(s: string): Promise<string>; 23 var numPromise: Promise<number>; 30 interface Promise<T> { [all …]
|
D | promiseType.js | 2 declare var p: Promise<boolean>; 50 return Promise.reject(Error()); 80 return Promise.reject(Error()); 97 const p18 = p.catch(() => Promise.reject(1)); 98 const p19 = p.catch(() => Promise.resolve(1)); 108 const p28 = p.then(() => Promise.resolve(1)); 109 const p29 = p.then(() => Promise.reject(1)); 119 const p38 = p.then(undefined, () => Promise.resolve(1)); 120 const p39 = p.then(undefined, () => Promise.reject(1)); 130 const p48 = p.then(null, () => Promise.resolve(1)); [all …]
|
D | promisePermutations3.types | 4 interface Promise<T> { 5 …en<U>(success?: (value: T) => Promise<U>, error?: (error: any) => Promise<U>, progress?: (progress… 6 …Promise<TResult1 | TResult2>; <U>(success?: (value: T) => Promise<U>, error?: (error: any) => Prom… 7 >success : (value: T) => Promise<U> 9 >error : (error: any) => Promise<U> 14 …then<U>(success?: (value: T) => Promise<U>, error?: (error: any) => U, progress?: (progress: any) … 15 …Promise<TResult1 | TResult2>; <U>(success?: (value: T) => Promise<U>, error?: (error: any) => Prom… 16 >success : (value: T) => Promise<U> 23 …cess?: (value: T) => U, error?: (error: any) => Promise<U>, progress?: (progress: any) => void): P… 24 …Promise<TResult1 | TResult2>; <U>(success?: (value: T) => Promise<U>, error?: (error: any) => Prom… [all …]
|
D | asyncAwait_es2017.types | 2 type MyPromise<T> = Promise<T>; 5 declare var MyPromise: typeof Promise; 7 >Promise : PromiseConstructor 9 declare var p: Promise<number>; 10 >p : Promise<number> 16 >f0 : () => Promise<void> 18 async function f1(): Promise<void> { } 19 >f1 : () => Promise<void> 25 >f4 : () => Promise<void> 26 >async function() { } : () => Promise<void> [all …]
|
D | asyncAwait_es5.types | 2 type MyPromise<T> = Promise<T>; 5 declare var MyPromise: typeof Promise; 7 >Promise : PromiseConstructor 9 declare var p: Promise<number>; 10 >p : Promise<number> 16 >f0 : () => Promise<void> 18 async function f1(): Promise<void> { } 19 >f1 : () => Promise<void> 25 >f4 : () => Promise<void> 26 >async function() { } : () => Promise<void> [all …]
|
D | asyncAwait_es6.types | 2 type MyPromise<T> = Promise<T>; 5 declare var MyPromise: typeof Promise; 7 >Promise : PromiseConstructor 9 declare var p: Promise<number>; 10 >p : Promise<number> 16 >f0 : () => Promise<void> 18 async function f1(): Promise<void> { } 19 >f1 : () => Promise<void> 25 >f4 : () => Promise<void> 26 >async function() { } : () => Promise<void> [all …]
|
/third_party/typescript/tests/cases/compiler/ |
D | bluebirdStaticThis.ts | 5 export declare class Promise<R> implements Promise.Thenable<R> { class 6 …constructor(callback: (resolve: (thenableOrResult: R | Promise.Thenable<R>) => void, reject: (erro… 7 …static try<R>(dit: typeof Promise, fn: () => Promise.Thenable<R>, args?: any[], ctx?: any): Promis… 8 static try<R>(dit: typeof Promise, fn: () => R, args?: any[], ctx?: any): Promise<R>; 10 …static attempt<R>(dit: typeof Promise, fn: () => Promise.Thenable<R>, args?: any[], ctx?: any): Pr… 11 static attempt<R>(dit: typeof Promise, fn: () => R, args?: any[], ctx?: any): Promise<R>; 13 static method(dit: typeof Promise, fn: Function): Function; 15 static resolve(dit: typeof Promise): Promise<void>; 16 static resolve<R>(dit: typeof Promise, value: Promise.Thenable<R>): Promise<R>; 17 static resolve<R>(dit: typeof Promise, value: R): Promise<R>; [all …]
|
D | promiseType.ts | 2 declare var p: Promise<boolean>; 50 return Promise.reject(Error()); 80 return Promise.reject(Error()); 97 const p18 = p.catch(() => Promise.reject(1)); 98 const p19 = p.catch(() => Promise.resolve(1)); 108 const p28 = p.then(() => Promise.resolve(1)); 109 const p29 = p.then(() => Promise.reject(1)); 119 const p38 = p.then(undefined, () => Promise.resolve(1)); 120 const p39 = p.then(undefined, () => Promise.reject(1)); 130 const p48 = p.then(null, () => Promise.resolve(1)); [all …]
|
/third_party/typescript/tests/cases/conformance/types/typeRelationships/typeInference/ |
D | genericCallToOverloadedMethodWithOverloadedArguments.ts | 3 interface Promise<T> { interface 4 then<U>(cb: (x: T) => Promise<U>): Promise<U>; 7 declare function testFunction(n: number): Promise<number>; 9 var numPromise: Promise<number>; 16 interface Promise<T> { 17 then<U>(cb: (x: T) => Promise<U>): Promise<U>; 20 declare function testFunction(n: number): Promise<number>; 21 declare function testFunction(s: string): Promise<string>; 23 var numPromise: Promise<number>; 30 interface Promise<T> { interface [all …]
|