File: promiseIdentity.symbols

package info (click to toggle)
node-typescript 3.3.3333-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 324,548 kB
  • sloc: makefile: 6; sh: 3
file content (89 lines) | stat: -rw-r--r-- 4,213 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
=== tests/cases/compiler/promiseIdentity.ts ===
export interface IPromise<T> {
>IPromise : Symbol(IPromise, Decl(promiseIdentity.ts, 0, 0))
>T : Symbol(T, Decl(promiseIdentity.ts, 0, 26))

    then<U>(callback: (x: T) => IPromise<U>): IPromise<U>;
>then : Symbol(IPromise.then, Decl(promiseIdentity.ts, 0, 30))
>U : Symbol(U, Decl(promiseIdentity.ts, 1, 9))
>callback : Symbol(callback, Decl(promiseIdentity.ts, 1, 12))
>x : Symbol(x, Decl(promiseIdentity.ts, 1, 23))
>T : Symbol(T, Decl(promiseIdentity.ts, 0, 26))
>IPromise : Symbol(IPromise, Decl(promiseIdentity.ts, 0, 0))
>U : Symbol(U, Decl(promiseIdentity.ts, 1, 9))
>IPromise : Symbol(IPromise, Decl(promiseIdentity.ts, 0, 0))
>U : Symbol(U, Decl(promiseIdentity.ts, 1, 9))
}
interface Promise<T> {
>Promise : Symbol(Promise, Decl(promiseIdentity.ts, 2, 1))
>T : Symbol(T, Decl(promiseIdentity.ts, 3, 18))

    then<U>(callback: (x: T) => Promise<U>): Promise<U>;
>then : Symbol(Promise.then, Decl(promiseIdentity.ts, 3, 22))
>U : Symbol(U, Decl(promiseIdentity.ts, 4, 9))
>callback : Symbol(callback, Decl(promiseIdentity.ts, 4, 12))
>x : Symbol(x, Decl(promiseIdentity.ts, 4, 23))
>T : Symbol(T, Decl(promiseIdentity.ts, 3, 18))
>Promise : Symbol(Promise, Decl(promiseIdentity.ts, 2, 1))
>U : Symbol(U, Decl(promiseIdentity.ts, 4, 9))
>Promise : Symbol(Promise, Decl(promiseIdentity.ts, 2, 1))
>U : Symbol(U, Decl(promiseIdentity.ts, 4, 9))
}
var x: IPromise<string>;
>x : Symbol(x, Decl(promiseIdentity.ts, 6, 3), Decl(promiseIdentity.ts, 7, 3))
>IPromise : Symbol(IPromise, Decl(promiseIdentity.ts, 0, 0))

var x: Promise<string>;
>x : Symbol(x, Decl(promiseIdentity.ts, 6, 3), Decl(promiseIdentity.ts, 7, 3))
>Promise : Symbol(Promise, Decl(promiseIdentity.ts, 2, 1))


interface IPromise2<T, V> {
>IPromise2 : Symbol(IPromise2, Decl(promiseIdentity.ts, 7, 23))
>T : Symbol(T, Decl(promiseIdentity.ts, 10, 20))
>V : Symbol(V, Decl(promiseIdentity.ts, 10, 22))

    then<U, W>(callback: (x: T) => IPromise2<U, W>): IPromise2<W, U>;
>then : Symbol(IPromise2.then, Decl(promiseIdentity.ts, 10, 27))
>U : Symbol(U, Decl(promiseIdentity.ts, 11, 9))
>W : Symbol(W, Decl(promiseIdentity.ts, 11, 11))
>callback : Symbol(callback, Decl(promiseIdentity.ts, 11, 15))
>x : Symbol(x, Decl(promiseIdentity.ts, 11, 26))
>T : Symbol(T, Decl(promiseIdentity.ts, 10, 20))
>IPromise2 : Symbol(IPromise2, Decl(promiseIdentity.ts, 7, 23))
>U : Symbol(U, Decl(promiseIdentity.ts, 11, 9))
>W : Symbol(W, Decl(promiseIdentity.ts, 11, 11))
>IPromise2 : Symbol(IPromise2, Decl(promiseIdentity.ts, 7, 23))
>W : Symbol(W, Decl(promiseIdentity.ts, 11, 11))
>U : Symbol(U, Decl(promiseIdentity.ts, 11, 9))
}
interface Promise2<T, V> {
>Promise2 : Symbol(Promise2, Decl(promiseIdentity.ts, 12, 1))
>T : Symbol(T, Decl(promiseIdentity.ts, 13, 19))
>V : Symbol(V, Decl(promiseIdentity.ts, 13, 21))

    then<U, W>(callback: (x: V) => Promise2<U, T>): Promise2<T, W>; // Uses V instead of T in callback's parameter
>then : Symbol(Promise2.then, Decl(promiseIdentity.ts, 13, 26))
>U : Symbol(U, Decl(promiseIdentity.ts, 14, 9))
>W : Symbol(W, Decl(promiseIdentity.ts, 14, 11))
>callback : Symbol(callback, Decl(promiseIdentity.ts, 14, 15))
>x : Symbol(x, Decl(promiseIdentity.ts, 14, 26))
>V : Symbol(V, Decl(promiseIdentity.ts, 13, 21))
>Promise2 : Symbol(Promise2, Decl(promiseIdentity.ts, 12, 1))
>U : Symbol(U, Decl(promiseIdentity.ts, 14, 9))
>T : Symbol(T, Decl(promiseIdentity.ts, 13, 19))
>Promise2 : Symbol(Promise2, Decl(promiseIdentity.ts, 12, 1))
>T : Symbol(T, Decl(promiseIdentity.ts, 13, 19))
>W : Symbol(W, Decl(promiseIdentity.ts, 14, 11))
}

// Ok because T in this particular Promise2 is any, as are all the U and W references.
// Also, the V of Promise2 happens to coincide with the T of IPromise2 (they are both string).
var y: IPromise2<string, number>;
>y : Symbol(y, Decl(promiseIdentity.ts, 19, 3), Decl(promiseIdentity.ts, 20, 3))
>IPromise2 : Symbol(IPromise2, Decl(promiseIdentity.ts, 7, 23))

var y: Promise2<any, string>;
>y : Symbol(y, Decl(promiseIdentity.ts, 19, 3), Decl(promiseIdentity.ts, 20, 3))
>Promise2 : Symbol(Promise2, Decl(promiseIdentity.ts, 12, 1))