File: genericCallWithOverloadedFunctionTypedArguments.symbols

package info (click to toggle)
node-typescript 2.1.5-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 203,952 kB
  • ctags: 52,987
  • sloc: sh: 11; makefile: 5
file content (163 lines) | stat: -rw-r--r-- 10,609 bytes parent folder | download | duplicates (7)
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
=== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOverloadedFunctionTypedArguments.ts ===
// Function typed arguments with multiple signatures must be passed an implementation that matches all of them
// Inferences are made quadratic-pairwise to and from these overload sets

module NonGenericParameter {
>NonGenericParameter : Symbol(NonGenericParameter, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 0, 0))

    var a: {
>a : Symbol(a, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 4, 7))

        (x: boolean): boolean;
>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 5, 9))

        (x: string): string;
>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 6, 9))
    }

    function foo4(cb: typeof a) {
>foo4 : Symbol(foo4, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 7, 5))
>cb : Symbol(cb, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 9, 18))
>a : Symbol(a, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 4, 7))

        return cb;
>cb : Symbol(cb, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 9, 18))
    }

    var r = foo4(a);
>r : Symbol(r, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 13, 7))
>foo4 : Symbol(foo4, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 7, 5))
>a : Symbol(a, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 4, 7))

    var r2 = foo4(<T>(x: T) => x);
>r2 : Symbol(r2, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 14, 7))
>foo4 : Symbol(foo4, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 7, 5))
>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 14, 19))
>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 14, 22))
>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 14, 19))
>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 14, 22))

    var r4 = foo4(x => x);    
>r4 : Symbol(r4, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 15, 7))
>foo4 : Symbol(foo4, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 7, 5))
>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 15, 18))
>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 15, 18))
}

module GenericParameter {
>GenericParameter : Symbol(GenericParameter, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 16, 1))

    function foo5<T>(cb: { (x: T): string; (x: number): T }) {
>foo5 : Symbol(foo5, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 18, 25))
>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 19, 18))
>cb : Symbol(cb, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 19, 21))
>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 19, 28))
>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 19, 18))
>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 19, 44))
>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 19, 18))

        return cb;
>cb : Symbol(cb, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 19, 21))
    }

    var r5 = foo5(x => x); // any => string (+1 overload) [inferences are made for T, but lambda not contextually typed]. T is any
>r5 : Symbol(r5, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 23, 7))
>foo5 : Symbol(foo5, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 18, 25))
>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 23, 18))
>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 23, 18))

    var a: { <T>(x: T): string; <T>(x: number): T; }
>a : Symbol(a, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 24, 7), Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 41, 7))
>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 24, 14))
>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 24, 17))
>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 24, 14))
>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 24, 33))
>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 24, 36))
>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 24, 33))

    var r7 = foo5(a); // any => string (+1 overload)
>r7 : Symbol(r7, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 25, 7))
>foo5 : Symbol(foo5, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 18, 25))
>a : Symbol(a, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 24, 7), Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 41, 7))

    function foo6<T>(cb: { (x: T): string; (x: T, y?: T): string }) {
>foo6 : Symbol(foo6, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 25, 21))
>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 27, 18))
>cb : Symbol(cb, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 27, 21))
>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 27, 28))
>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 27, 18))
>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 27, 44))
>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 27, 18))
>y : Symbol(y, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 27, 49))
>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 27, 18))

        return cb;
>cb : Symbol(cb, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 27, 21))
    }

    var r8 = foo6(x => x); // any => string (+1 overload) [inferences are made for T, but lambda not contextually typed]. T is any
>r8 : Symbol(r8, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 31, 7))
>foo6 : Symbol(foo6, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 25, 21))
>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 31, 18))
>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 31, 18))

    var r9 = foo6(<T>(x: T) => ''); // any => string (+1 overload)
>r9 : Symbol(r9, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 32, 7))
>foo6 : Symbol(foo6, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 25, 21))
>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 32, 19))
>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 32, 22))
>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 32, 19))

    var r11 = foo6(<T>(x: T, y?: T) => ''); // any => string (+1 overload)
>r11 : Symbol(r11, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 33, 7))
>foo6 : Symbol(foo6, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 25, 21))
>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 33, 20))
>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 33, 23))
>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 33, 20))
>y : Symbol(y, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 33, 28))
>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 33, 20))

    function foo7<T>(x:T, cb: { (x: T): string; (x: T, y?: T): string }) {
>foo7 : Symbol(foo7, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 33, 43))
>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 35, 18))
>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 35, 21))
>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 35, 18))
>cb : Symbol(cb, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 35, 25))
>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 35, 33))
>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 35, 18))
>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 35, 49))
>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 35, 18))
>y : Symbol(y, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 35, 54))
>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 35, 18))

        return cb;
>cb : Symbol(cb, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 35, 25))
    }

    var r12 = foo7(1, (x) => x); // any => string (+1 overload) [inferences are made for T, but lambda not contextually typed]
>r12 : Symbol(r12, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 39, 7))
>foo7 : Symbol(foo7, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 33, 43))
>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 39, 23))
>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 39, 23))

    var r13 = foo7(1, <T>(x: T) => ''); // any => string (+1 overload) [inferences are made for T, but lambda not contextually typed]
>r13 : Symbol(r13, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 40, 7))
>foo7 : Symbol(foo7, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 33, 43))
>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 40, 23))
>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 40, 26))
>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 40, 23))

    var a: { <T>(x: T): string; <T>(x: number): T; }
>a : Symbol(a, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 24, 7), Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 41, 7))
>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 41, 14))
>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 41, 17))
>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 41, 14))
>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 41, 33))
>x : Symbol(x, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 41, 36))
>T : Symbol(T, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 41, 33))

    var r14 = foo7(1, a); // any => string (+1 overload) [inferences are made for T, but lambda not contextually typed]
>r14 : Symbol(r14, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 42, 7))
>foo7 : Symbol(foo7, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 33, 43))
>a : Symbol(a, Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 24, 7), Decl(genericCallWithOverloadedFunctionTypedArguments.ts, 41, 7))
}