From 348a4e96893e35ab8794197dc0add2a36bcc28e7 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 8 Jul 2016 17:13:12 -0700 Subject: [PATCH] Fixed up tests that used 'string[]' instead of 'TemplateStringsArray'. --- ...gedTemplateStringsTypeArgumentInference.ts | 22 +++++++++---------- ...TemplateStringsTypeArgumentInferenceES6.ts | 22 +++++++++---------- ...emplateStringsWithIncompatibleTypedTags.ts | 2 +- ...lateStringsWithIncompatibleTypedTagsES6.ts | 2 +- ...StringsWithManyCallAndMemberExpressions.ts | 2 +- ...ingsWithManyCallAndMemberExpressionsES6.ts | 2 +- ...dTemplateStringsWithOverloadResolution1.ts | 8 +++---- ...plateStringsWithOverloadResolution1_ES6.ts | 8 +++---- ...dTemplateStringsWithOverloadResolution2.ts | 8 +++---- ...plateStringsWithOverloadResolution2_ES6.ts | 8 +++---- .../taggedTemplateStringsWithTypedTags.ts | 2 +- .../taggedTemplateStringsWithTypedTagsES6.ts | 2 +- ...eHelpTaggedTemplatesWithOverloadedTags3.ts | 8 +++---- ...eHelpTaggedTemplatesWithOverloadedTags7.ts | 8 +++---- 14 files changed, 52 insertions(+), 52 deletions(-) diff --git a/tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts b/tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts index 961544f309a..17f2ea6b848 100644 --- a/tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts +++ b/tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts @@ -5,60 +5,60 @@ function noParams(n: T) { } noParams ``; // Generic tag with parameter which does not use type parameter -function noGenericParams(n: string[]) { } +function noGenericParams(n: TemplateStringsArray) { } noGenericParams ``; // Generic tag with multiple type parameters and only one used in parameter type annotation function someGenerics1a(n: T, m: number) { } someGenerics1a `${3}`; -function someGenerics1b(n: string[], m: U) { } +function someGenerics1b(n: TemplateStringsArray, m: U) { } someGenerics1b `${3}`; // Generic tag with argument of function type whose parameter is of type parameter type -function someGenerics2a(strs: string[], n: (x: T) => void) { } +function someGenerics2a(strs: TemplateStringsArray, n: (x: T) => void) { } someGenerics2a `${(n: string) => n}`; -function someGenerics2b(strs: string[], n: (x: T, y: U) => void) { } +function someGenerics2b(strs: TemplateStringsArray, n: (x: T, y: U) => void) { } someGenerics2b `${ (n: string, x: number) => n }`; // Generic tag with argument of function type whose parameter is not of type parameter type but body/return type uses type parameter -function someGenerics3(strs: string[], producer: () => T) { } +function someGenerics3(strs: TemplateStringsArray, producer: () => T) { } someGenerics3 `${() => ''}`; someGenerics3 `${() => undefined}`; someGenerics3 `${() => 3}`; // 2 parameter generic tag with argument 1 of type parameter type and argument 2 of function type whose parameter is of type parameter type -function someGenerics4(strs: string[], n: T, f: (x: U) => void) { } +function someGenerics4(strs: TemplateStringsArray, n: T, f: (x: U) => void) { } someGenerics4 `${4}${ () => null }`; someGenerics4 `${''}${ () => 3 }`; someGenerics4 `${ null }${ null }`; // 2 parameter generic tag with argument 2 of type parameter type and argument 1 of function type whose parameter is of type parameter type -function someGenerics5(strs: string[], n: T, f: (x: U) => void) { } +function someGenerics5(strs: TemplateStringsArray, n: T, f: (x: U) => void) { } someGenerics5 `${ 4 } ${ () => null }`; someGenerics5 `${ '' }${ () => 3 }`; someGenerics5 `${null}${null}`; // Generic tag with multiple arguments of function types that each have parameters of the same generic type -function someGenerics6(strs: string[], a: (a: A) => A, b: (b: A) => A, c: (c: A) => A) { } +function someGenerics6(strs: TemplateStringsArray, a: (a: A) => A, b: (b: A) => A, c: (c: A) => A) { } someGenerics6 `${ n => n }${ n => n}${ n => n}`; someGenerics6 `${ n => n }${ n => n}${ n => n}`; someGenerics6 `${ (n: number) => n }${ (n: number) => n }${ (n: number) => n }`; // Generic tag with multiple arguments of function types that each have parameters of different generic type -function someGenerics7(strs: string[], a: (a: A) => A, b: (b: B) => B, c: (c: C) => C) { } +function someGenerics7(strs: TemplateStringsArray, a: (a: A) => A, b: (b: B) => B, c: (c: C) => C) { } someGenerics7 `${ n => n }${ n => n }${ n => n }`; someGenerics7 `${ n => n }${ n => n }${ n => n }`; someGenerics7 `${(n: number) => n}${ (n: string) => n}${ (n: number) => n}`; // Generic tag with argument of generic function type -function someGenerics8(strs: string[], n: T): T { return n; } +function someGenerics8(strs: TemplateStringsArray, n: T): T { return n; } var x = someGenerics8 `${ someGenerics7 }`; x `${null}${null}${null}`; // Generic tag with multiple parameters of generic type passed arguments with no best common type -function someGenerics9(strs: string[], a: T, b: T, c: T): T { +function someGenerics9(strs: TemplateStringsArray, a: T, b: T, c: T): T { return null; } var a9a = someGenerics9 `${ '' }${ 0 }${ [] }`; diff --git a/tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInferenceES6.ts b/tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInferenceES6.ts index bc9fd75cac9..a0ca1aa67d6 100644 --- a/tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInferenceES6.ts +++ b/tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInferenceES6.ts @@ -5,60 +5,60 @@ function noParams(n: T) { } noParams ``; // Generic tag with parameter which does not use type parameter -function noGenericParams(n: string[]) { } +function noGenericParams(n: TemplateStringsArray) { } noGenericParams ``; // Generic tag with multiple type parameters and only one used in parameter type annotation function someGenerics1a(n: T, m: number) { } someGenerics1a `${3}`; -function someGenerics1b(n: string[], m: U) { } +function someGenerics1b(n: TemplateStringsArray, m: U) { } someGenerics1b `${3}`; // Generic tag with argument of function type whose parameter is of type parameter type -function someGenerics2a(strs: string[], n: (x: T) => void) { } +function someGenerics2a(strs: TemplateStringsArray, n: (x: T) => void) { } someGenerics2a `${(n: string) => n}`; -function someGenerics2b(strs: string[], n: (x: T, y: U) => void) { } +function someGenerics2b(strs: TemplateStringsArray, n: (x: T, y: U) => void) { } someGenerics2b `${ (n: string, x: number) => n }`; // Generic tag with argument of function type whose parameter is not of type parameter type but body/return type uses type parameter -function someGenerics3(strs: string[], producer: () => T) { } +function someGenerics3(strs: TemplateStringsArray, producer: () => T) { } someGenerics3 `${() => ''}`; someGenerics3 `${() => undefined}`; someGenerics3 `${() => 3}`; // 2 parameter generic tag with argument 1 of type parameter type and argument 2 of function type whose parameter is of type parameter type -function someGenerics4(strs: string[], n: T, f: (x: U) => void) { } +function someGenerics4(strs: TemplateStringsArray, n: T, f: (x: U) => void) { } someGenerics4 `${4}${ () => null }`; someGenerics4 `${''}${ () => 3 }`; someGenerics4 `${ null }${ null }`; // 2 parameter generic tag with argument 2 of type parameter type and argument 1 of function type whose parameter is of type parameter type -function someGenerics5(strs: string[], n: T, f: (x: U) => void) { } +function someGenerics5(strs: TemplateStringsArray, n: T, f: (x: U) => void) { } someGenerics5 `${ 4 } ${ () => null }`; someGenerics5 `${ '' }${ () => 3 }`; someGenerics5 `${null}${null}`; // Generic tag with multiple arguments of function types that each have parameters of the same generic type -function someGenerics6(strs: string[], a: (a: A) => A, b: (b: A) => A, c: (c: A) => A) { } +function someGenerics6(strs: TemplateStringsArray, a: (a: A) => A, b: (b: A) => A, c: (c: A) => A) { } someGenerics6 `${ n => n }${ n => n}${ n => n}`; someGenerics6 `${ n => n }${ n => n}${ n => n}`; someGenerics6 `${ (n: number) => n }${ (n: number) => n }${ (n: number) => n }`; // Generic tag with multiple arguments of function types that each have parameters of different generic type -function someGenerics7(strs: string[], a: (a: A) => A, b: (b: B) => B, c: (c: C) => C) { } +function someGenerics7(strs: TemplateStringsArray, a: (a: A) => A, b: (b: B) => B, c: (c: C) => C) { } someGenerics7 `${ n => n }${ n => n }${ n => n }`; someGenerics7 `${ n => n }${ n => n }${ n => n }`; someGenerics7 `${(n: number) => n}${ (n: string) => n}${ (n: number) => n}`; // Generic tag with argument of generic function type -function someGenerics8(strs: string[], n: T): T { return n; } +function someGenerics8(strs: TemplateStringsArray, n: T): T { return n; } var x = someGenerics8 `${ someGenerics7 }`; x `${null}${null}${null}`; // Generic tag with multiple parameters of generic type passed arguments with no best common type -function someGenerics9(strs: string[], a: T, b: T, c: T): T { +function someGenerics9(strs: TemplateStringsArray, a: T, b: T, c: T): T { return null; } var a9a = someGenerics9 `${ '' }${ 0 }${ [] }`; diff --git a/tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts b/tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts index 0f5d203d60b..d8be6cbd7c2 100644 --- a/tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts +++ b/tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts @@ -1,5 +1,5 @@ interface I { - (stringParts: string[], ...rest: boolean[]): I; + (stringParts: TemplateStringsArray, ...rest: boolean[]): I; g: I; h: I; member: I; diff --git a/tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTagsES6.ts b/tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTagsES6.ts index 36dc249f672..dec483c1678 100644 --- a/tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTagsES6.ts +++ b/tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTagsES6.ts @@ -1,6 +1,6 @@ // @target: ES6 interface I { - (stringParts: string[], ...rest: boolean[]): I; + (stringParts: TemplateStringsArray, ...rest: boolean[]): I; g: I; h: I; member: I; diff --git a/tests/cases/conformance/es6/templates/taggedTemplateStringsWithManyCallAndMemberExpressions.ts b/tests/cases/conformance/es6/templates/taggedTemplateStringsWithManyCallAndMemberExpressions.ts index d96196ee26e..f86353e7dda 100644 --- a/tests/cases/conformance/es6/templates/taggedTemplateStringsWithManyCallAndMemberExpressions.ts +++ b/tests/cases/conformance/es6/templates/taggedTemplateStringsWithManyCallAndMemberExpressions.ts @@ -1,5 +1,5 @@ interface I { - (strs: string[], ...subs: number[]): I; + (strs: TemplateStringsArray, ...subs: number[]): I; member: { new (s: string): { new (n: number): { diff --git a/tests/cases/conformance/es6/templates/taggedTemplateStringsWithManyCallAndMemberExpressionsES6.ts b/tests/cases/conformance/es6/templates/taggedTemplateStringsWithManyCallAndMemberExpressionsES6.ts index d0d6604cfde..914f7ca809f 100644 --- a/tests/cases/conformance/es6/templates/taggedTemplateStringsWithManyCallAndMemberExpressionsES6.ts +++ b/tests/cases/conformance/es6/templates/taggedTemplateStringsWithManyCallAndMemberExpressionsES6.ts @@ -1,6 +1,6 @@ // @target: ES6 interface I { - (strs: string[], ...subs: number[]): I; + (strs: TemplateStringsArray, ...subs: number[]): I; member: { new (s: string): { new (n: number): { diff --git a/tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts b/tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts index 5b29beddd48..3743c1a7710 100644 --- a/tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts +++ b/tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts @@ -1,7 +1,7 @@ -function foo(strs: string[]): number; -function foo(strs: string[], x: number): string; -function foo(strs: string[], x: number, y: number): boolean; -function foo(strs: string[], x: number, y: string): {}; +function foo(strs: TemplateStringsArray): number; +function foo(strs: TemplateStringsArray, x: number): string; +function foo(strs: TemplateStringsArray, x: number, y: number): boolean; +function foo(strs: TemplateStringsArray, x: number, y: string): {}; function foo(...stuff: any[]): any { return undefined; } diff --git a/tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts b/tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts index f821d84fbdd..d681c6b98b0 100644 --- a/tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts +++ b/tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts @@ -1,8 +1,8 @@ //@target: es6 -function foo(strs: string[]): number; -function foo(strs: string[], x: number): string; -function foo(strs: string[], x: number, y: number): boolean; -function foo(strs: string[], x: number, y: string): {}; +function foo(strs: TemplateStringsArray): number; +function foo(strs: TemplateStringsArray, x: number): string; +function foo(strs: TemplateStringsArray, x: number, y: number): boolean; +function foo(strs: TemplateStringsArray, x: number, y: string): {}; function foo(...stuff: any[]): any { return undefined; } diff --git a/tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution2.ts b/tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution2.ts index 0ed9b86128b..98799dd92df 100644 --- a/tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution2.ts +++ b/tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution2.ts @@ -5,8 +5,8 @@ function foo1(...stuff: any[]): any { return undefined; } -var a = foo1 `${1}`; // string -var b = foo1([], 1); // number +var a = foo1 `${1}`; +var b = foo1([], 1); function foo2(strs: string[], x: number): number; function foo2(strs: TemplateStringsArray, x: number): string; @@ -14,5 +14,5 @@ function foo2(...stuff: any[]): any { return undefined; } -var c = foo2 `${1}`; // number -var d = foo2([], 1); // number \ No newline at end of file +var c = foo2 `${1}`; +var d = foo2([], 1); \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution2_ES6.ts b/tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution2_ES6.ts index 6c67de325e2..769c56e47a1 100644 --- a/tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution2_ES6.ts +++ b/tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution2_ES6.ts @@ -5,8 +5,8 @@ function foo1(...stuff: any[]): any { return undefined; } -var a = foo1 `${1}`; // string -var b = foo1([], 1); // number +var a = foo1 `${1}`; +var b = foo1([], 1); function foo2(strs: string[], x: number): number; function foo2(strs: TemplateStringsArray, x: number): string; @@ -14,5 +14,5 @@ function foo2(...stuff: any[]): any { return undefined; } -var c = foo2 `${1}`; // number -var d = foo2([], 1); // number \ No newline at end of file +var c = foo2 `${1}`; +var d = foo2([], 1); \ No newline at end of file diff --git a/tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts b/tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts index 9b3852c2ddb..60f97104be3 100644 --- a/tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts +++ b/tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTags.ts @@ -1,5 +1,5 @@ interface I { - (stringParts: string[], ...rest: number[]): I; + (stringParts: TemplateStringsArray, ...rest: number[]): I; g: I; h: I; member: I; diff --git a/tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTagsES6.ts b/tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTagsES6.ts index 0dc10820a98..19fb6a874cc 100644 --- a/tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTagsES6.ts +++ b/tests/cases/conformance/es6/templates/taggedTemplateStringsWithTypedTagsES6.ts @@ -1,6 +1,6 @@ // @target: ES6 interface I { - (stringParts: string[], ...rest: number[]): I; + (stringParts: TemplateStringsArray, ...rest: number[]): I; g: I; h: I; member: I; diff --git a/tests/cases/fourslash/signatureHelpTaggedTemplatesWithOverloadedTags3.ts b/tests/cases/fourslash/signatureHelpTaggedTemplatesWithOverloadedTags3.ts index 3843ed34b16..b919afc7703 100644 --- a/tests/cases/fourslash/signatureHelpTaggedTemplatesWithOverloadedTags3.ts +++ b/tests/cases/fourslash/signatureHelpTaggedTemplatesWithOverloadedTags3.ts @@ -1,8 +1,8 @@ /// -//// function f(templateStrings: string[], p1_o1: string): number; -//// function f(templateStrings: string[], p1_o2: number, p2_o2: number, p3_o2: number): string; -//// function f(templateStrings: string[], p1_o3: string, p2_o3: boolean, p3_o3: number): boolean; +//// function f(templateStrings: TemplateStringsArray, p1_o1: string): number; +//// function f(templateStrings: TemplateStringsArray, p1_o2: number, p2_o2: number, p3_o2: number): string; +//// function f(templateStrings: TemplateStringsArray, p1_o3: string, p2_o3: boolean, p3_o3: number): boolean; //// function f(...foo[]: any) { return ""; } //// //// f `${/*1*/ "s/*2*/tring" /*3*/ } ${ @@ -14,7 +14,7 @@ test.markers().forEach(m => { verify.signatureHelpArgumentCountIs(3); verify.currentSignatureParameterCountIs(4); - verify.currentSignatureHelpIs('f(templateStrings: string[], p1_o3: string, p2_o3: boolean, p3_o3: number): boolean'); + verify.currentSignatureHelpIs('f(templateStrings: TemplateStringsArray, p1_o3: string, p2_o3: boolean, p3_o3: number): boolean'); verify.currentParameterHelpArgumentNameIs("p1_o3"); verify.currentParameterSpanIs("p1_o3: string"); }); \ No newline at end of file diff --git a/tests/cases/fourslash/signatureHelpTaggedTemplatesWithOverloadedTags7.ts b/tests/cases/fourslash/signatureHelpTaggedTemplatesWithOverloadedTags7.ts index 9a24aacf86b..5f706b8c0fa 100644 --- a/tests/cases/fourslash/signatureHelpTaggedTemplatesWithOverloadedTags7.ts +++ b/tests/cases/fourslash/signatureHelpTaggedTemplatesWithOverloadedTags7.ts @@ -1,8 +1,8 @@ /// -//// function f(templateStrings: string[], p1_o1: string): number; -//// function f(templateStrings: string[], p1_o2: number, p2_o2: number, p3_o2: number): string; -//// function f(templateStrings: string[], p1_o3: string, p2_o3: boolean, p3_o3: number): boolean; +//// function f(templateStrings: TemplateStringsArray, p1_o1: string): number; +//// function f(templateStrings: TemplateStringsArray, p1_o2: number, p2_o2: number, p3_o2: number): string; +//// function f(templateStrings: TemplateStringsArray, p1_o3: string, p2_o3: boolean, p3_o3: number): boolean; //// function f(...foo[]: any) { return ""; } //// //// f `${ } ${/*1*/ fa/*2*/lse /*3*/} @@ -14,7 +14,7 @@ test.markers().forEach(m => { verify.signatureHelpArgumentCountIs(3); verify.currentSignatureParameterCountIs(4); - verify.currentSignatureHelpIs('f(templateStrings: string[], p1_o3: string, p2_o3: boolean, p3_o3: number): boolean'); + verify.currentSignatureHelpIs('f(templateStrings: TemplateStringsArray, p1_o3: string, p2_o3: boolean, p3_o3: number): boolean'); verify.currentParameterHelpArgumentNameIs("p2_o3"); verify.currentParameterSpanIs("p2_o3: boolean"); }); \ No newline at end of file