tests/cases/compiler/bluebirdStaticThis.ts(5,22): error TS2420: Class 'Promise' incorrectly implements interface 'Thenable'. Property 'then' is missing in type 'Promise' but required in type 'Thenable'. tests/cases/compiler/bluebirdStaticThis.ts(22,51): error TS2694: Namespace '"tests/cases/compiler/bluebirdStaticThis".Promise' has no exported member 'Resolver'. tests/cases/compiler/bluebirdStaticThis.ts(57,109): error TS2694: Namespace '"tests/cases/compiler/bluebirdStaticThis".Promise' has no exported member 'Inspection'. tests/cases/compiler/bluebirdStaticThis.ts(58,91): error TS2694: Namespace '"tests/cases/compiler/bluebirdStaticThis".Promise' has no exported member 'Inspection'. tests/cases/compiler/bluebirdStaticThis.ts(59,91): error TS2694: Namespace '"tests/cases/compiler/bluebirdStaticThis".Promise' has no exported member 'Inspection'. tests/cases/compiler/bluebirdStaticThis.ts(60,73): error TS2694: Namespace '"tests/cases/compiler/bluebirdStaticThis".Promise' has no exported member 'Inspection'. ==== tests/cases/compiler/bluebirdStaticThis.ts (6 errors) ==== // This version is reduced from the full d.ts by removing almost all the tests // and all the comments. // Then it adds explicit `this` arguments to the static members. // Tests by: Bart van der Schoor export declare class Promise implements Promise.Thenable { ~~~~~~~ !!! error TS2420: Class 'Promise' incorrectly implements interface 'Thenable'. !!! error TS2420: Property 'then' is missing in type 'Promise' but required in type 'Thenable'. !!! related TS2728 tests/cases/compiler/bluebirdStaticThis.ts:113:3: 'then' is declared here. constructor(callback: (resolve: (thenableOrResult: R | Promise.Thenable) => void, reject: (error: any) => void) => void); static try(dit: typeof Promise, fn: () => Promise.Thenable, args?: any[], ctx?: any): Promise; static try(dit: typeof Promise, fn: () => R, args?: any[], ctx?: any): Promise; static attempt(dit: typeof Promise, fn: () => Promise.Thenable, args?: any[], ctx?: any): Promise; static attempt(dit: typeof Promise, fn: () => R, args?: any[], ctx?: any): Promise; static method(dit: typeof Promise, fn: Function): Function; static resolve(dit: typeof Promise): Promise; static resolve(dit: typeof Promise, value: Promise.Thenable): Promise; static resolve(dit: typeof Promise, value: R): Promise; static reject(dit: typeof Promise, reason: any): Promise; static reject(dit: typeof Promise, reason: any): Promise; static defer(dit: typeof Promise): Promise.Resolver; ~~~~~~~~ !!! error TS2694: Namespace '"tests/cases/compiler/bluebirdStaticThis".Promise' has no exported member 'Resolver'. static cast(dit: typeof Promise, value: Promise.Thenable): Promise; static cast(dit: typeof Promise, value: R): Promise; static bind(dit: typeof Promise, thisArg: any): Promise; static is(dit: typeof Promise, value: any): boolean; static longStackTraces(dit: typeof Promise): void; static delay(dit: typeof Promise, value: Promise.Thenable, ms: number): Promise; static delay(dit: typeof Promise, value: R, ms: number): Promise; static delay(dit: typeof Promise, ms: number): Promise; static promisify(dit: typeof Promise, nodeFunction: Function, receiver?: any): Function; static promisifyAll(dit: typeof Promise, target: Object): Object; static coroutine(dit: typeof Promise, generatorFunction: Function): Function; static spawn(dit: typeof Promise, generatorFunction: Function): Promise; static noConflict(dit: typeof Promise): typeof Promise; static onPossiblyUnhandledRejection(dit: typeof Promise, handler: (reason: any) => any): void; static all(dit: typeof Promise, values: Promise.Thenable[]>): Promise; static all(dit: typeof Promise, values: Promise.Thenable): Promise; static all(dit: typeof Promise, values: Promise.Thenable[]): Promise; static all(dit: typeof Promise, values: R[]): Promise; static props(dit: typeof Promise, object: Promise): Promise; static props(dit: typeof Promise, object: Object): Promise; static settle(dit: typeof Promise, values: Promise.Thenable[]>): Promise[]>; ~~~~~~~~~~ !!! error TS2694: Namespace '"tests/cases/compiler/bluebirdStaticThis".Promise' has no exported member 'Inspection'. static settle(dit: typeof Promise, values: Promise.Thenable): Promise[]>; ~~~~~~~~~~ !!! error TS2694: Namespace '"tests/cases/compiler/bluebirdStaticThis".Promise' has no exported member 'Inspection'. static settle(dit: typeof Promise, values: Promise.Thenable[]): Promise[]>; ~~~~~~~~~~ !!! error TS2694: Namespace '"tests/cases/compiler/bluebirdStaticThis".Promise' has no exported member 'Inspection'. static settle(dit: typeof Promise, values: R[]): Promise[]>; ~~~~~~~~~~ !!! error TS2694: Namespace '"tests/cases/compiler/bluebirdStaticThis".Promise' has no exported member 'Inspection'. static any(dit: typeof Promise, values: Promise.Thenable[]>): Promise; static any(dit: typeof Promise, values: Promise.Thenable): Promise; static any(dit: typeof Promise, values: Promise.Thenable[]): Promise; static any(dit: typeof Promise, values: R[]): Promise; static race(dit: typeof Promise, values: Promise.Thenable[]>): Promise; static race(dit: typeof Promise, values: Promise.Thenable): Promise; static race(dit: typeof Promise, values: Promise.Thenable[]): Promise; static race(dit: typeof Promise, values: R[]): Promise; static some(dit: typeof Promise, values: Promise.Thenable[]>, count: number): Promise; static some(dit: typeof Promise, values: Promise.Thenable, count: number): Promise; static some(dit: typeof Promise, values: Promise.Thenable[], count: number): Promise; static some(dit: typeof Promise, values: R[], count: number): Promise; static join(dit: typeof Promise, ...values: Promise.Thenable[]): Promise; static join(dit: typeof Promise, ...values: R[]): Promise; static map(dit: typeof Promise, values: Promise.Thenable[]>, mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; static map(dit: typeof Promise, values: Promise.Thenable[]>, mapper: (item: R, index: number, arrayLength: number) => U): Promise; static map(dit: typeof Promise, values: Promise.Thenable, mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; static map(dit: typeof Promise, values: Promise.Thenable, mapper: (item: R, index: number, arrayLength: number) => U): Promise; static map(dit: typeof Promise, values: Promise.Thenable[], mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; static map(dit: typeof Promise, values: Promise.Thenable[], mapper: (item: R, index: number, arrayLength: number) => U): Promise; static map(dit: typeof Promise, values: R[], mapper: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; static map(dit: typeof Promise, values: R[], mapper: (item: R, index: number, arrayLength: number) => U): Promise; static reduce(dit: typeof Promise, values: Promise.Thenable[]>, reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; static reduce(dit: typeof Promise, values: Promise.Thenable[]>, reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; static reduce(dit: typeof Promise, values: Promise.Thenable, reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; static reduce(dit: typeof Promise, values: Promise.Thenable, reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; static reduce(dit: typeof Promise, values: Promise.Thenable[], reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; static reduce(dit: typeof Promise, values: Promise.Thenable[], reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; static reduce(dit: typeof Promise, values: R[], reducer: (total: U, current: R, index: number, arrayLength: number) => Promise.Thenable, initialValue?: U): Promise; static reduce(dit: typeof Promise, values: R[], reducer: (total: U, current: R, index: number, arrayLength: number) => U, initialValue?: U): Promise; static filter(dit: typeof Promise, values: Promise.Thenable[]>, filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; static filter(dit: typeof Promise, values: Promise.Thenable[]>, filterer: (item: R, index: number, arrayLength: number) => boolean): Promise; static filter(dit: typeof Promise, values: Promise.Thenable, filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; static filter(dit: typeof Promise, values: Promise.Thenable, filterer: (item: R, index: number, arrayLength: number) => boolean): Promise; static filter(dit: typeof Promise, values: Promise.Thenable[], filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; static filter(dit: typeof Promise, values: Promise.Thenable[], filterer: (item: R, index: number, arrayLength: number) => boolean): Promise; static filter(dit: typeof Promise, values: R[], filterer: (item: R, index: number, arrayLength: number) => Promise.Thenable): Promise; static filter(dit: typeof Promise, values: R[], filterer: (item: R, index: number, arrayLength: number) => boolean): Promise; } export declare module Promise { export interface Thenable { then(onFulfilled: (value: R) => Thenable, onRejected: (error: any) => Thenable): Thenable; then(onFulfilled: (value: R) => Thenable, onRejected?: (error: any) => U): Thenable; then(onFulfilled: (value: R) => U, onRejected: (error: any) => Thenable): Thenable; then(onFulfilled?: (value: R) => U, onRejected?: (error: any) => U): Thenable; } } interface Foo { a: number; b: string; } var x: any; var arr: any[]; var foo: Foo; var fooProm: Promise; fooProm = Promise.try(Promise, () => { return foo; }); fooProm = Promise.try(Promise, () => { return foo; }, arr); fooProm = Promise.try(Promise, () => { return foo; }, arr, x);