2014-08-15 23:33:16 +02:00
|
|
|
=== tests/cases/compiler/promiseIdentityWithAny.ts ===
|
|
|
|
interface IPromise<T, V> {
|
|
|
|
>IPromise : IPromise<T, V>
|
|
|
|
>T : T
|
|
|
|
>V : V
|
|
|
|
|
|
|
|
then<U, W>(callback: (x: T) => IPromise<U, W>): IPromise<U, W>;
|
|
|
|
>then : <U, W>(callback: (x: T) => IPromise<U, W>) => IPromise<U, W>
|
|
|
|
>U : U
|
|
|
|
>W : W
|
|
|
|
>callback : (x: T) => IPromise<U, W>
|
|
|
|
>x : T
|
|
|
|
>T : T
|
2014-08-19 04:56:03 +02:00
|
|
|
>IPromise : IPromise<T, V>
|
2014-08-15 23:33:16 +02:00
|
|
|
>U : U
|
|
|
|
>W : W
|
2014-08-19 04:56:03 +02:00
|
|
|
>IPromise : IPromise<T, V>
|
2014-08-15 23:33:16 +02:00
|
|
|
>U : U
|
|
|
|
>W : W
|
|
|
|
}
|
|
|
|
interface Promise<T, V> {
|
|
|
|
>Promise : Promise<T, V>
|
|
|
|
>T : T
|
|
|
|
>V : V
|
|
|
|
|
|
|
|
then<U, W>(callback: (x: T) => Promise<any, any>): Promise<any, any>;
|
|
|
|
>then : <U, W>(callback: (x: T) => Promise<any, any>) => Promise<any, any>
|
|
|
|
>U : U
|
|
|
|
>W : W
|
|
|
|
>callback : (x: T) => Promise<any, any>
|
|
|
|
>x : T
|
|
|
|
>T : T
|
2014-08-19 04:56:03 +02:00
|
|
|
>Promise : Promise<T, V>
|
|
|
|
>Promise : Promise<T, V>
|
2014-08-15 23:33:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Should be ok because signature type parameters get erased to any
|
|
|
|
var x: IPromise<string, number>;
|
|
|
|
>x : IPromise<string, number>
|
2014-08-19 04:56:03 +02:00
|
|
|
>IPromise : IPromise<T, V>
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
var x: Promise<string, boolean>;
|
|
|
|
>x : IPromise<string, number>
|
2014-08-19 04:56:03 +02:00
|
|
|
>Promise : Promise<T, V>
|
2014-08-15 23:33:16 +02:00
|
|
|
|