mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-07 05:41:22 -06:00
Fixed up tests that used 'string[]' instead of 'TemplateStringsArray'.
This commit is contained in:
parent
4de0a05402
commit
348a4e9689
@ -5,60 +5,60 @@ function noParams<T>(n: T) { }
|
||||
noParams ``;
|
||||
|
||||
// Generic tag with parameter which does not use type parameter
|
||||
function noGenericParams<T>(n: string[]) { }
|
||||
function noGenericParams<T>(n: TemplateStringsArray) { }
|
||||
noGenericParams ``;
|
||||
|
||||
// Generic tag with multiple type parameters and only one used in parameter type annotation
|
||||
function someGenerics1a<T, U>(n: T, m: number) { }
|
||||
someGenerics1a `${3}`;
|
||||
|
||||
function someGenerics1b<T, U>(n: string[], m: U) { }
|
||||
function someGenerics1b<T, U>(n: TemplateStringsArray, m: U) { }
|
||||
someGenerics1b `${3}`;
|
||||
|
||||
// Generic tag with argument of function type whose parameter is of type parameter type
|
||||
function someGenerics2a<T>(strs: string[], n: (x: T) => void) { }
|
||||
function someGenerics2a<T>(strs: TemplateStringsArray, n: (x: T) => void) { }
|
||||
someGenerics2a `${(n: string) => n}`;
|
||||
|
||||
function someGenerics2b<T, U>(strs: string[], n: (x: T, y: U) => void) { }
|
||||
function someGenerics2b<T, U>(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<T>(strs: string[], producer: () => T) { }
|
||||
function someGenerics3<T>(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<T, U>(strs: string[], n: T, f: (x: U) => void) { }
|
||||
function someGenerics4<T, U>(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<U, T>(strs: string[], n: T, f: (x: U) => void) { }
|
||||
function someGenerics5<U, T>(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<A>(strs: string[], a: (a: A) => A, b: (b: A) => A, c: (c: A) => A) { }
|
||||
function someGenerics6<A>(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<A, B, C>(strs: string[], a: (a: A) => A, b: (b: B) => B, c: (c: C) => C) { }
|
||||
function someGenerics7<A, B, C>(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<T>(strs: string[], n: T): T { return n; }
|
||||
function someGenerics8<T>(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<T>(strs: string[], a: T, b: T, c: T): T {
|
||||
function someGenerics9<T>(strs: TemplateStringsArray, a: T, b: T, c: T): T {
|
||||
return null;
|
||||
}
|
||||
var a9a = someGenerics9 `${ '' }${ 0 }${ [] }`;
|
||||
|
||||
@ -5,60 +5,60 @@ function noParams<T>(n: T) { }
|
||||
noParams ``;
|
||||
|
||||
// Generic tag with parameter which does not use type parameter
|
||||
function noGenericParams<T>(n: string[]) { }
|
||||
function noGenericParams<T>(n: TemplateStringsArray) { }
|
||||
noGenericParams ``;
|
||||
|
||||
// Generic tag with multiple type parameters and only one used in parameter type annotation
|
||||
function someGenerics1a<T, U>(n: T, m: number) { }
|
||||
someGenerics1a `${3}`;
|
||||
|
||||
function someGenerics1b<T, U>(n: string[], m: U) { }
|
||||
function someGenerics1b<T, U>(n: TemplateStringsArray, m: U) { }
|
||||
someGenerics1b `${3}`;
|
||||
|
||||
// Generic tag with argument of function type whose parameter is of type parameter type
|
||||
function someGenerics2a<T>(strs: string[], n: (x: T) => void) { }
|
||||
function someGenerics2a<T>(strs: TemplateStringsArray, n: (x: T) => void) { }
|
||||
someGenerics2a `${(n: string) => n}`;
|
||||
|
||||
function someGenerics2b<T, U>(strs: string[], n: (x: T, y: U) => void) { }
|
||||
function someGenerics2b<T, U>(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<T>(strs: string[], producer: () => T) { }
|
||||
function someGenerics3<T>(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<T, U>(strs: string[], n: T, f: (x: U) => void) { }
|
||||
function someGenerics4<T, U>(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<U, T>(strs: string[], n: T, f: (x: U) => void) { }
|
||||
function someGenerics5<U, T>(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<A>(strs: string[], a: (a: A) => A, b: (b: A) => A, c: (c: A) => A) { }
|
||||
function someGenerics6<A>(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<A, B, C>(strs: string[], a: (a: A) => A, b: (b: B) => B, c: (c: C) => C) { }
|
||||
function someGenerics7<A, B, C>(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<T>(strs: string[], n: T): T { return n; }
|
||||
function someGenerics8<T>(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<T>(strs: string[], a: T, b: T, c: T): T {
|
||||
function someGenerics9<T>(strs: TemplateStringsArray, a: T, b: T, c: T): T {
|
||||
return null;
|
||||
}
|
||||
var a9a = someGenerics9 `${ '' }${ 0 }${ [] }`;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
interface I {
|
||||
(stringParts: string[], ...rest: boolean[]): I;
|
||||
(stringParts: TemplateStringsArray, ...rest: boolean[]): I;
|
||||
g: I;
|
||||
h: I;
|
||||
member: I;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
// @target: ES6
|
||||
interface I {
|
||||
(stringParts: string[], ...rest: boolean[]): I;
|
||||
(stringParts: TemplateStringsArray, ...rest: boolean[]): I;
|
||||
g: I;
|
||||
h: I;
|
||||
member: I;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
interface I {
|
||||
(strs: string[], ...subs: number[]): I;
|
||||
(strs: TemplateStringsArray, ...subs: number[]): I;
|
||||
member: {
|
||||
new (s: string): {
|
||||
new (n: number): {
|
||||
|
||||
@ -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): {
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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
|
||||
var c = foo2 `${1}`;
|
||||
var d = foo2([], 1);
|
||||
@ -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
|
||||
var c = foo2 `${1}`;
|
||||
var d = foo2([], 1);
|
||||
@ -1,5 +1,5 @@
|
||||
interface I {
|
||||
(stringParts: string[], ...rest: number[]): I;
|
||||
(stringParts: TemplateStringsArray, ...rest: number[]): I;
|
||||
g: I;
|
||||
h: I;
|
||||
member: I;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
// @target: ES6
|
||||
interface I {
|
||||
(stringParts: string[], ...rest: number[]): I;
|
||||
(stringParts: TemplateStringsArray, ...rest: number[]): I;
|
||||
g: I;
|
||||
h: I;
|
||||
member: I;
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
//// 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");
|
||||
});
|
||||
@ -1,8 +1,8 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
//// 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");
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user