File: specializedSignatureIsNotSubtypeOfNonSpecializedSignature.js

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 (141 lines) | stat: -rw-r--r-- 2,281 bytes parent folder | download | duplicates (2)
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
//// [specializedSignatureIsNotSubtypeOfNonSpecializedSignature.ts]

function foo(x: 'a');
function foo(x: number) { }

class C {
    foo(x: 'a');
    foo(x: number);
    foo(x: any) { }
}

class C2<T> {
    foo(x: 'a');
    foo(x: T);
    foo(x: any) { }
}

class C3<T extends String> {
    foo(x: 'a');
    foo(x: T);
    foo(x: any) { }
}

interface I {
    (x: 'a');
    (x: number);
    foo(x: 'a');
    foo(x: number);
}

interface I2<T> {
    (x: 'a');
    (x: T);
    foo(x: 'a');
    foo(x: T);
}

interface I3<T extends String> {
    (x: 'a');
    (x: T);
    foo(x: 'a');
    foo(x: T);
}

var a: {
    (x: 'a');
    (x: number);
    foo(x: 'a');
    foo(x: number);
}

var a2: {
    (x: 'a');
    <T>(x: T);
    foo(x: 'a');
    foo<T>(x: T);
}

var a3: {
    (x: 'a');
    <T>(x: T);
    foo(x: 'a');
    foo<T extends String>(x: T);
}


//// [specializedSignatureIsNotSubtypeOfNonSpecializedSignature.js]
function foo(x) { }
var C = (function () {
    function C() {
    }
    C.prototype.foo = function (x) { };
    return C;
}());
var C2 = (function () {
    function C2() {
    }
    C2.prototype.foo = function (x) { };
    return C2;
}());
var C3 = (function () {
    function C3() {
    }
    C3.prototype.foo = function (x) { };
    return C3;
}());
var a;
var a2;
var a3;


//// [specializedSignatureIsNotSubtypeOfNonSpecializedSignature.d.ts]
declare function foo(x: 'a'): any;
declare class C {
    foo(x: 'a'): any;
    foo(x: number): any;
}
declare class C2<T> {
    foo(x: 'a'): any;
    foo(x: T): any;
}
declare class C3<T extends String> {
    foo(x: 'a'): any;
    foo(x: T): any;
}
interface I {
    (x: 'a'): any;
    (x: number): any;
    foo(x: 'a'): any;
    foo(x: number): any;
}
interface I2<T> {
    (x: 'a'): any;
    (x: T): any;
    foo(x: 'a'): any;
    foo(x: T): any;
}
interface I3<T extends String> {
    (x: 'a'): any;
    (x: T): any;
    foo(x: 'a'): any;
    foo(x: T): any;
}
declare var a: {
    (x: 'a');
    (x: number);
    foo(x: 'a');
    foo(x: number);
};
declare var a2: {
    (x: 'a');
    <T>(x: T);
    foo(x: 'a');
    foo<T>(x: T);
};
declare var a3: {
    (x: 'a');
    <T>(x: T);
    foo(x: 'a');
    foo<T extends String>(x: T);
};