Skip to content

Commit 3470ef5

Browse files
Fixed up tests that used 'string[]' instead of 'TemplateStringsArray'.
1 parent 1ef7375 commit 3470ef5

14 files changed

+52
-52
lines changed

tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,60 +5,60 @@ function noParams<T>(n: T) { }
55
noParams ``;
66

77
// Generic tag with parameter which does not use type parameter
8-
function noGenericParams<T>(n: string[]) { }
8+
function noGenericParams<T>(n: TemplateStringsArray) { }
99
noGenericParams ``;
1010

1111
// Generic tag with multiple type parameters and only one used in parameter type annotation
1212
function someGenerics1a<T, U>(n: T, m: number) { }
1313
someGenerics1a `${3}`;
1414

15-
function someGenerics1b<T, U>(n: string[], m: U) { }
15+
function someGenerics1b<T, U>(n: TemplateStringsArray, m: U) { }
1616
someGenerics1b `${3}`;
1717

1818
// Generic tag with argument of function type whose parameter is of type parameter type
19-
function someGenerics2a<T>(strs: string[], n: (x: T) => void) { }
19+
function someGenerics2a<T>(strs: TemplateStringsArray, n: (x: T) => void) { }
2020
someGenerics2a `${(n: string) => n}`;
2121

22-
function someGenerics2b<T, U>(strs: string[], n: (x: T, y: U) => void) { }
22+
function someGenerics2b<T, U>(strs: TemplateStringsArray, n: (x: T, y: U) => void) { }
2323
someGenerics2b `${ (n: string, x: number) => n }`;
2424

2525
// Generic tag with argument of function type whose parameter is not of type parameter type but body/return type uses type parameter
26-
function someGenerics3<T>(strs: string[], producer: () => T) { }
26+
function someGenerics3<T>(strs: TemplateStringsArray, producer: () => T) { }
2727
someGenerics3 `${() => ''}`;
2828
someGenerics3 `${() => undefined}`;
2929
someGenerics3 `${() => 3}`;
3030

3131
// 2 parameter generic tag with argument 1 of type parameter type and argument 2 of function type whose parameter is of type parameter type
32-
function someGenerics4<T, U>(strs: string[], n: T, f: (x: U) => void) { }
32+
function someGenerics4<T, U>(strs: TemplateStringsArray, n: T, f: (x: U) => void) { }
3333
someGenerics4 `${4}${ () => null }`;
3434
someGenerics4 `${''}${ () => 3 }`;
3535
someGenerics4 `${ null }${ null }`;
3636

3737
// 2 parameter generic tag with argument 2 of type parameter type and argument 1 of function type whose parameter is of type parameter type
38-
function someGenerics5<U, T>(strs: string[], n: T, f: (x: U) => void) { }
38+
function someGenerics5<U, T>(strs: TemplateStringsArray, n: T, f: (x: U) => void) { }
3939
someGenerics5 `${ 4 } ${ () => null }`;
4040
someGenerics5 `${ '' }${ () => 3 }`;
4141
someGenerics5 `${null}${null}`;
4242

4343
// Generic tag with multiple arguments of function types that each have parameters of the same generic type
44-
function someGenerics6<A>(strs: string[], a: (a: A) => A, b: (b: A) => A, c: (c: A) => A) { }
44+
function someGenerics6<A>(strs: TemplateStringsArray, a: (a: A) => A, b: (b: A) => A, c: (c: A) => A) { }
4545
someGenerics6 `${ n => n }${ n => n}${ n => n}`;
4646
someGenerics6 `${ n => n }${ n => n}${ n => n}`;
4747
someGenerics6 `${ (n: number) => n }${ (n: number) => n }${ (n: number) => n }`;
4848

4949
// Generic tag with multiple arguments of function types that each have parameters of different generic type
50-
function someGenerics7<A, B, C>(strs: string[], a: (a: A) => A, b: (b: B) => B, c: (c: C) => C) { }
50+
function someGenerics7<A, B, C>(strs: TemplateStringsArray, a: (a: A) => A, b: (b: B) => B, c: (c: C) => C) { }
5151
someGenerics7 `${ n => n }${ n => n }${ n => n }`;
5252
someGenerics7 `${ n => n }${ n => n }${ n => n }`;
5353
someGenerics7 `${(n: number) => n}${ (n: string) => n}${ (n: number) => n}`;
5454

5555
// Generic tag with argument of generic function type
56-
function someGenerics8<T>(strs: string[], n: T): T { return n; }
56+
function someGenerics8<T>(strs: TemplateStringsArray, n: T): T { return n; }
5757
var x = someGenerics8 `${ someGenerics7 }`;
5858
x `${null}${null}${null}`;
5959

6060
// Generic tag with multiple parameters of generic type passed arguments with no best common type
61-
function someGenerics9<T>(strs: string[], a: T, b: T, c: T): T {
61+
function someGenerics9<T>(strs: TemplateStringsArray, a: T, b: T, c: T): T {
6262
return null;
6363
}
6464
var a9a = someGenerics9 `${ '' }${ 0 }${ [] }`;

tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInferenceES6.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,60 +5,60 @@ function noParams<T>(n: T) { }
55
noParams ``;
66

77
// Generic tag with parameter which does not use type parameter
8-
function noGenericParams<T>(n: string[]) { }
8+
function noGenericParams<T>(n: TemplateStringsArray) { }
99
noGenericParams ``;
1010

1111
// Generic tag with multiple type parameters and only one used in parameter type annotation
1212
function someGenerics1a<T, U>(n: T, m: number) { }
1313
someGenerics1a `${3}`;
1414

15-
function someGenerics1b<T, U>(n: string[], m: U) { }
15+
function someGenerics1b<T, U>(n: TemplateStringsArray, m: U) { }
1616
someGenerics1b `${3}`;
1717

1818
// Generic tag with argument of function type whose parameter is of type parameter type
19-
function someGenerics2a<T>(strs: string[], n: (x: T) => void) { }
19+
function someGenerics2a<T>(strs: TemplateStringsArray, n: (x: T) => void) { }
2020
someGenerics2a `${(n: string) => n}`;
2121

22-
function someGenerics2b<T, U>(strs: string[], n: (x: T, y: U) => void) { }
22+
function someGenerics2b<T, U>(strs: TemplateStringsArray, n: (x: T, y: U) => void) { }
2323
someGenerics2b `${ (n: string, x: number) => n }`;
2424

2525
// Generic tag with argument of function type whose parameter is not of type parameter type but body/return type uses type parameter
26-
function someGenerics3<T>(strs: string[], producer: () => T) { }
26+
function someGenerics3<T>(strs: TemplateStringsArray, producer: () => T) { }
2727
someGenerics3 `${() => ''}`;
2828
someGenerics3 `${() => undefined}`;
2929
someGenerics3 `${() => 3}`;
3030

3131
// 2 parameter generic tag with argument 1 of type parameter type and argument 2 of function type whose parameter is of type parameter type
32-
function someGenerics4<T, U>(strs: string[], n: T, f: (x: U) => void) { }
32+
function someGenerics4<T, U>(strs: TemplateStringsArray, n: T, f: (x: U) => void) { }
3333
someGenerics4 `${4}${ () => null }`;
3434
someGenerics4 `${''}${ () => 3 }`;
3535
someGenerics4 `${ null }${ null }`;
3636

3737
// 2 parameter generic tag with argument 2 of type parameter type and argument 1 of function type whose parameter is of type parameter type
38-
function someGenerics5<U, T>(strs: string[], n: T, f: (x: U) => void) { }
38+
function someGenerics5<U, T>(strs: TemplateStringsArray, n: T, f: (x: U) => void) { }
3939
someGenerics5 `${ 4 } ${ () => null }`;
4040
someGenerics5 `${ '' }${ () => 3 }`;
4141
someGenerics5 `${null}${null}`;
4242

4343
// Generic tag with multiple arguments of function types that each have parameters of the same generic type
44-
function someGenerics6<A>(strs: string[], a: (a: A) => A, b: (b: A) => A, c: (c: A) => A) { }
44+
function someGenerics6<A>(strs: TemplateStringsArray, a: (a: A) => A, b: (b: A) => A, c: (c: A) => A) { }
4545
someGenerics6 `${ n => n }${ n => n}${ n => n}`;
4646
someGenerics6 `${ n => n }${ n => n}${ n => n}`;
4747
someGenerics6 `${ (n: number) => n }${ (n: number) => n }${ (n: number) => n }`;
4848

4949
// Generic tag with multiple arguments of function types that each have parameters of different generic type
50-
function someGenerics7<A, B, C>(strs: string[], a: (a: A) => A, b: (b: B) => B, c: (c: C) => C) { }
50+
function someGenerics7<A, B, C>(strs: TemplateStringsArray, a: (a: A) => A, b: (b: B) => B, c: (c: C) => C) { }
5151
someGenerics7 `${ n => n }${ n => n }${ n => n }`;
5252
someGenerics7 `${ n => n }${ n => n }${ n => n }`;
5353
someGenerics7 `${(n: number) => n}${ (n: string) => n}${ (n: number) => n}`;
5454

5555
// Generic tag with argument of generic function type
56-
function someGenerics8<T>(strs: string[], n: T): T { return n; }
56+
function someGenerics8<T>(strs: TemplateStringsArray, n: T): T { return n; }
5757
var x = someGenerics8 `${ someGenerics7 }`;
5858
x `${null}${null}${null}`;
5959

6060
// Generic tag with multiple parameters of generic type passed arguments with no best common type
61-
function someGenerics9<T>(strs: string[], a: T, b: T, c: T): T {
61+
function someGenerics9<T>(strs: TemplateStringsArray, a: T, b: T, c: T): T {
6262
return null;
6363
}
6464
var a9a = someGenerics9 `${ '' }${ 0 }${ [] }`;

tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
interface I {
2-
(stringParts: string[], ...rest: boolean[]): I;
2+
(stringParts: TemplateStringsArray, ...rest: boolean[]): I;
33
g: I;
44
h: I;
55
member: I;

tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTagsES6.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @target: ES6
22
interface I {
3-
(stringParts: string[], ...rest: boolean[]): I;
3+
(stringParts: TemplateStringsArray, ...rest: boolean[]): I;
44
g: I;
55
h: I;
66
member: I;

tests/cases/conformance/es6/templates/taggedTemplateStringsWithManyCallAndMemberExpressions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
interface I {
2-
(strs: string[], ...subs: number[]): I;
2+
(strs: TemplateStringsArray, ...subs: number[]): I;
33
member: {
44
new (s: string): {
55
new (n: number): {

tests/cases/conformance/es6/templates/taggedTemplateStringsWithManyCallAndMemberExpressionsES6.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @target: ES6
22
interface I {
3-
(strs: string[], ...subs: number[]): I;
3+
(strs: TemplateStringsArray, ...subs: number[]): I;
44
member: {
55
new (s: string): {
66
new (n: number): {

tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
function foo(strs: string[]): number;
2-
function foo(strs: string[], x: number): string;
3-
function foo(strs: string[], x: number, y: number): boolean;
4-
function foo(strs: string[], x: number, y: string): {};
1+
function foo(strs: TemplateStringsArray): number;
2+
function foo(strs: TemplateStringsArray, x: number): string;
3+
function foo(strs: TemplateStringsArray, x: number, y: number): boolean;
4+
function foo(strs: TemplateStringsArray, x: number, y: string): {};
55
function foo(...stuff: any[]): any {
66
return undefined;
77
}

tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
//@target: es6
2-
function foo(strs: string[]): number;
3-
function foo(strs: string[], x: number): string;
4-
function foo(strs: string[], x: number, y: number): boolean;
5-
function foo(strs: string[], x: number, y: string): {};
2+
function foo(strs: TemplateStringsArray): number;
3+
function foo(strs: TemplateStringsArray, x: number): string;
4+
function foo(strs: TemplateStringsArray, x: number, y: number): boolean;
5+
function foo(strs: TemplateStringsArray, x: number, y: string): {};
66
function foo(...stuff: any[]): any {
77
return undefined;
88
}

tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution2.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ function foo1(...stuff: any[]): any {
55
return undefined;
66
}
77

8-
var a = foo1 `${1}`; // string
9-
var b = foo1([], 1); // number
8+
var a = foo1 `${1}`;
9+
var b = foo1([], 1);
1010

1111
function foo2(strs: string[], x: number): number;
1212
function foo2(strs: TemplateStringsArray, x: number): string;
1313
function foo2(...stuff: any[]): any {
1414
return undefined;
1515
}
1616

17-
var c = foo2 `${1}`; // number
18-
var d = foo2([], 1); // number
17+
var c = foo2 `${1}`;
18+
var d = foo2([], 1);

tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution2_ES6.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ function foo1(...stuff: any[]): any {
55
return undefined;
66
}
77

8-
var a = foo1 `${1}`; // string
9-
var b = foo1([], 1); // number
8+
var a = foo1 `${1}`;
9+
var b = foo1([], 1);
1010

1111
function foo2(strs: string[], x: number): number;
1212
function foo2(strs: TemplateStringsArray, x: number): string;
1313
function foo2(...stuff: any[]): any {
1414
return undefined;
1515
}
1616

17-
var c = foo2 `${1}`; // number
18-
var d = foo2([], 1); // number
17+
var c = foo2 `${1}`;
18+
var d = foo2([], 1);

tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
interface I {
2-
(stringParts: string[], ...rest: number[]): I;
2+
(stringParts: TemplateStringsArray, ...rest: number[]): I;
33
g: I;
44
h: I;
55
member: I;

tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTagsES6.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @target: ES6
22
interface I {
3-
(stringParts: string[], ...rest: number[]): I;
3+
(stringParts: TemplateStringsArray, ...rest: number[]): I;
44
g: I;
55
h: I;
66
member: I;
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/// <reference path='fourslash.ts' />
22

3-
//// function f(templateStrings: string[], p1_o1: string): number;
4-
//// function f(templateStrings: string[], p1_o2: number, p2_o2: number, p3_o2: number): string;
5-
//// function f(templateStrings: string[], p1_o3: string, p2_o3: boolean, p3_o3: number): boolean;
3+
//// function f(templateStrings: TemplateStringsArray, p1_o1: string): number;
4+
//// function f(templateStrings: TemplateStringsArray, p1_o2: number, p2_o2: number, p3_o2: number): string;
5+
//// function f(templateStrings: TemplateStringsArray, p1_o3: string, p2_o3: boolean, p3_o3: number): boolean;
66
//// function f(...foo[]: any) { return ""; }
77
////
88
//// f `${/*1*/ "s/*2*/tring" /*3*/ } ${
@@ -14,7 +14,7 @@ test.markers().forEach(m => {
1414
verify.signatureHelpArgumentCountIs(3);
1515

1616
verify.currentSignatureParameterCountIs(4);
17-
verify.currentSignatureHelpIs('f(templateStrings: string[], p1_o3: string, p2_o3: boolean, p3_o3: number): boolean');
17+
verify.currentSignatureHelpIs('f(templateStrings: TemplateStringsArray, p1_o3: string, p2_o3: boolean, p3_o3: number): boolean');
1818
verify.currentParameterHelpArgumentNameIs("p1_o3");
1919
verify.currentParameterSpanIs("p1_o3: string");
2020
});
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/// <reference path='fourslash.ts' />
22

3-
//// function f(templateStrings: string[], p1_o1: string): number;
4-
//// function f(templateStrings: string[], p1_o2: number, p2_o2: number, p3_o2: number): string;
5-
//// function f(templateStrings: string[], p1_o3: string, p2_o3: boolean, p3_o3: number): boolean;
3+
//// function f(templateStrings: TemplateStringsArray, p1_o1: string): number;
4+
//// function f(templateStrings: TemplateStringsArray, p1_o2: number, p2_o2: number, p3_o2: number): string;
5+
//// function f(templateStrings: TemplateStringsArray, p1_o3: string, p2_o3: boolean, p3_o3: number): boolean;
66
//// function f(...foo[]: any) { return ""; }
77
////
88
//// f `${ } ${/*1*/ fa/*2*/lse /*3*/}
@@ -14,7 +14,7 @@ test.markers().forEach(m => {
1414
verify.signatureHelpArgumentCountIs(3);
1515

1616
verify.currentSignatureParameterCountIs(4);
17-
verify.currentSignatureHelpIs('f(templateStrings: string[], p1_o3: string, p2_o3: boolean, p3_o3: number): boolean');
17+
verify.currentSignatureHelpIs('f(templateStrings: TemplateStringsArray, p1_o3: string, p2_o3: boolean, p3_o3: number): boolean');
1818
verify.currentParameterHelpArgumentNameIs("p2_o3");
1919
verify.currentParameterSpanIs("p2_o3: boolean");
2020
});

0 commit comments

Comments
 (0)