TypeScript Version:
1.9.0-dev.20160502
Code
declare namespace Windows.Foundation {
interface IPromise<TResult> {
then<U>(success?: (value: TResult) => IPromise<U>, error?: (error: any) => IPromise<U>, progress?: (progress: any) => void): IPromise<U>;
then<U>(success?: (value: TResult) => IPromise<U>, error?: (error: any) => U, progress?: (progress: any) => void): IPromise<U>;
then<U>(success?: (value: TResult) => U, error?: (error: any) => IPromise<U>, progress?: (progress: any) => void): IPromise<U>;
then<U>(success?: (value: TResult) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise<U>;
done<U>(success?: (value: TResult) => any, error?: (error: any) => any, progress?: (progress: any) => void): void;
cancel(): void;
}
}
async function sample(promise: Windows.Foundation.IPromise<number>) {
var number = await promise;
}
Expected behavior:
No error, as this is an await-compatible Promise definition; more concretely, those are definitions for UWP APIs and they worked well with a stable TypeScript.
Actual behavior:
Compiler emits an error Operand for 'await' does not have a valid callable 'then' member..
TypeScript Version:
1.9.0-dev.20160502
Code
Expected behavior:
No error, as this is an await-compatible Promise definition; more concretely, those are definitions for UWP APIs and they worked well with a stable TypeScript.
Actual behavior:
Compiler emits an error
Operand for 'await' does not have a valid callable 'then' member..