@@ -57,49 +57,83 @@ export function fooWithSingleOverload(a: any) {
57
57
>a : Symbol(a, Decl(declFileFunctions_0.ts, 21, 38))
58
58
}
59
59
60
+ export function fooWithTypePredicate(a: any): a is number {
61
+ >fooWithTypePredicate : Symbol(fooWithTypePredicate, Decl(declFileFunctions_0.ts, 23, 1))
62
+ >a : Symbol(a, Decl(declFileFunctions_0.ts, 25, 37))
63
+ >a : Symbol(a, Decl(declFileFunctions_0.ts, 25, 37))
64
+
65
+ return true;
66
+ }
67
+ export function fooWithTypePredicateAndMulitpleParams(a: any, b: any, c: any): a is number {
68
+ >fooWithTypePredicateAndMulitpleParams : Symbol(fooWithTypePredicateAndMulitpleParams, Decl(declFileFunctions_0.ts, 27, 1))
69
+ >a : Symbol(a, Decl(declFileFunctions_0.ts, 28, 54))
70
+ >b : Symbol(b, Decl(declFileFunctions_0.ts, 28, 61))
71
+ >c : Symbol(c, Decl(declFileFunctions_0.ts, 28, 69))
72
+ >a : Symbol(a, Decl(declFileFunctions_0.ts, 28, 54))
73
+
74
+ return true;
75
+ }
76
+ export function fooWithTypeTypePredicateAndGeneric<T>(a: any): a is T {
77
+ >fooWithTypeTypePredicateAndGeneric : Symbol(fooWithTypeTypePredicateAndGeneric, Decl(declFileFunctions_0.ts, 30, 1))
78
+ >T : Symbol(T, Decl(declFileFunctions_0.ts, 31, 51))
79
+ >a : Symbol(a, Decl(declFileFunctions_0.ts, 31, 54))
80
+ >a : Symbol(a, Decl(declFileFunctions_0.ts, 31, 54))
81
+ >T : Symbol(T, Decl(declFileFunctions_0.ts, 31, 51))
82
+
83
+ return true;
84
+ }
85
+ export function fooWithTypeTypePredicateAndRestParam(a: any, ...rest): a is number {
86
+ >fooWithTypeTypePredicateAndRestParam : Symbol(fooWithTypeTypePredicateAndRestParam, Decl(declFileFunctions_0.ts, 33, 1))
87
+ >a : Symbol(a, Decl(declFileFunctions_0.ts, 34, 53))
88
+ >rest : Symbol(rest, Decl(declFileFunctions_0.ts, 34, 60))
89
+ >a : Symbol(a, Decl(declFileFunctions_0.ts, 34, 53))
90
+
91
+ return true;
92
+ }
93
+
60
94
/** This comment should appear for nonExportedFoo*/
61
95
function nonExportedFoo() {
62
- >nonExportedFoo : Symbol(nonExportedFoo, Decl(declFileFunctions_0.ts, 23 , 1))
96
+ >nonExportedFoo : Symbol(nonExportedFoo, Decl(declFileFunctions_0.ts, 36 , 1))
63
97
}
64
98
/** This is comment for function signature*/
65
99
function nonExportedFooWithParameters(/** this is comment about a*/a: string,
66
- >nonExportedFooWithParameters : Symbol(nonExportedFooWithParameters, Decl(declFileFunctions_0.ts, 27 , 1))
67
- >a : Symbol(a, Decl(declFileFunctions_0.ts, 29 , 38))
100
+ >nonExportedFooWithParameters : Symbol(nonExportedFooWithParameters, Decl(declFileFunctions_0.ts, 40 , 1))
101
+ >a : Symbol(a, Decl(declFileFunctions_0.ts, 42 , 38))
68
102
69
103
/** this is comment for b*/
70
104
b: number) {
71
- >b : Symbol(b, Decl(declFileFunctions_0.ts, 29 , 77))
105
+ >b : Symbol(b, Decl(declFileFunctions_0.ts, 42 , 77))
72
106
73
107
var d = a;
74
- >d : Symbol(d, Decl(declFileFunctions_0.ts, 32 , 7))
75
- >a : Symbol(a, Decl(declFileFunctions_0.ts, 29 , 38))
108
+ >d : Symbol(d, Decl(declFileFunctions_0.ts, 45 , 7))
109
+ >a : Symbol(a, Decl(declFileFunctions_0.ts, 42 , 38))
76
110
}
77
111
function nonExportedFooWithRestParameters(a: string, ...rests: string[]) {
78
- >nonExportedFooWithRestParameters : Symbol(nonExportedFooWithRestParameters, Decl(declFileFunctions_0.ts, 33 , 1))
79
- >a : Symbol(a, Decl(declFileFunctions_0.ts, 34 , 42))
80
- >rests : Symbol(rests, Decl(declFileFunctions_0.ts, 34 , 52))
112
+ >nonExportedFooWithRestParameters : Symbol(nonExportedFooWithRestParameters, Decl(declFileFunctions_0.ts, 46 , 1))
113
+ >a : Symbol(a, Decl(declFileFunctions_0.ts, 47 , 42))
114
+ >rests : Symbol(rests, Decl(declFileFunctions_0.ts, 47 , 52))
81
115
82
116
return a + rests.join("");
83
- >a : Symbol(a, Decl(declFileFunctions_0.ts, 34 , 42))
117
+ >a : Symbol(a, Decl(declFileFunctions_0.ts, 47 , 42))
84
118
>rests.join : Symbol(Array.join, Decl(lib.d.ts, 1035, 31))
85
- >rests : Symbol(rests, Decl(declFileFunctions_0.ts, 34 , 52))
119
+ >rests : Symbol(rests, Decl(declFileFunctions_0.ts, 47 , 52))
86
120
>join : Symbol(Array.join, Decl(lib.d.ts, 1035, 31))
87
121
}
88
122
89
123
function nonExportedFooWithOverloads(a: string): string;
90
- >nonExportedFooWithOverloads : Symbol(nonExportedFooWithOverloads, Decl(declFileFunctions_0.ts, 36 , 1), Decl(declFileFunctions_0.ts, 38 , 56), Decl(declFileFunctions_0.ts, 39 , 56))
91
- >a : Symbol(a, Decl(declFileFunctions_0.ts, 38 , 37))
124
+ >nonExportedFooWithOverloads : Symbol(nonExportedFooWithOverloads, Decl(declFileFunctions_0.ts, 49 , 1), Decl(declFileFunctions_0.ts, 51 , 56), Decl(declFileFunctions_0.ts, 52 , 56))
125
+ >a : Symbol(a, Decl(declFileFunctions_0.ts, 51 , 37))
92
126
93
127
function nonExportedFooWithOverloads(a: number): number;
94
- >nonExportedFooWithOverloads : Symbol(nonExportedFooWithOverloads, Decl(declFileFunctions_0.ts, 36 , 1), Decl(declFileFunctions_0.ts, 38 , 56), Decl(declFileFunctions_0.ts, 39 , 56))
95
- >a : Symbol(a, Decl(declFileFunctions_0.ts, 39 , 37))
128
+ >nonExportedFooWithOverloads : Symbol(nonExportedFooWithOverloads, Decl(declFileFunctions_0.ts, 49 , 1), Decl(declFileFunctions_0.ts, 51 , 56), Decl(declFileFunctions_0.ts, 52 , 56))
129
+ >a : Symbol(a, Decl(declFileFunctions_0.ts, 52 , 37))
96
130
97
131
function nonExportedFooWithOverloads(a: any): any {
98
- >nonExportedFooWithOverloads : Symbol(nonExportedFooWithOverloads, Decl(declFileFunctions_0.ts, 36 , 1), Decl(declFileFunctions_0.ts, 38 , 56), Decl(declFileFunctions_0.ts, 39 , 56))
99
- >a : Symbol(a, Decl(declFileFunctions_0.ts, 40 , 37))
132
+ >nonExportedFooWithOverloads : Symbol(nonExportedFooWithOverloads, Decl(declFileFunctions_0.ts, 49 , 1), Decl(declFileFunctions_0.ts, 51 , 56), Decl(declFileFunctions_0.ts, 52 , 56))
133
+ >a : Symbol(a, Decl(declFileFunctions_0.ts, 53 , 37))
100
134
101
135
return a;
102
- >a : Symbol(a, Decl(declFileFunctions_0.ts, 40 , 37))
136
+ >a : Symbol(a, Decl(declFileFunctions_0.ts, 53 , 37))
103
137
}
104
138
105
139
=== tests/cases/compiler/declFileFunctions_1.ts ===
0 commit comments