Accepted baselines.

This commit is contained in:
Daniel Rosenwasser 2016-07-20 18:07:45 -07:00
parent 3470ef5cbc
commit 6968ebf84e
30 changed files with 172 additions and 136 deletions

View File

@ -13,60 +13,60 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference
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 }${ [] }`;

View File

@ -6,60 +6,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 }${ [] }`;

View File

@ -12,60 +12,60 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference
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 }${ [] }`;

View File

@ -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 }${ [] }`;

View File

@ -8,7 +8,7 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTyped
==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTags.ts (6 errors) ====
interface I {
(stringParts: string[], ...rest: boolean[]): I;
(stringParts: TemplateStringsArray, ...rest: boolean[]): I;
g: I;
h: I;
member: I;

View File

@ -1,6 +1,6 @@
//// [taggedTemplateStringsWithIncompatibleTypedTags.ts]
interface I {
(stringParts: string[], ...rest: boolean[]): I;
(stringParts: TemplateStringsArray, ...rest: boolean[]): I;
g: I;
h: I;
member: I;

View File

@ -8,7 +8,7 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTyped
==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithIncompatibleTypedTagsES6.ts (6 errors) ====
interface I {
(stringParts: string[], ...rest: boolean[]): I;
(stringParts: TemplateStringsArray, ...rest: boolean[]): I;
g: I;
h: I;
member: I;

View File

@ -1,6 +1,6 @@
//// [taggedTemplateStringsWithIncompatibleTypedTagsES6.ts]
interface I {
(stringParts: string[], ...rest: boolean[]): I;
(stringParts: TemplateStringsArray, ...rest: boolean[]): I;
g: I;
h: I;
member: I;

View File

@ -1,6 +1,6 @@
//// [taggedTemplateStringsWithManyCallAndMemberExpressions.ts]
interface I {
(strs: string[], ...subs: number[]): I;
(strs: TemplateStringsArray, ...subs: number[]): I;
member: {
new (s: string): {
new (n: number): {

View File

@ -2,13 +2,14 @@
interface I {
>I : Symbol(I, Decl(taggedTemplateStringsWithManyCallAndMemberExpressions.ts, 0, 0))
(strs: string[], ...subs: number[]): I;
(strs: TemplateStringsArray, ...subs: number[]): I;
>strs : Symbol(strs, Decl(taggedTemplateStringsWithManyCallAndMemberExpressions.ts, 1, 5))
>subs : Symbol(subs, Decl(taggedTemplateStringsWithManyCallAndMemberExpressions.ts, 1, 20))
>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.d.ts, --, --))
>subs : Symbol(subs, Decl(taggedTemplateStringsWithManyCallAndMemberExpressions.ts, 1, 32))
>I : Symbol(I, Decl(taggedTemplateStringsWithManyCallAndMemberExpressions.ts, 0, 0))
member: {
>member : Symbol(I.member, Decl(taggedTemplateStringsWithManyCallAndMemberExpressions.ts, 1, 43))
>member : Symbol(I.member, Decl(taggedTemplateStringsWithManyCallAndMemberExpressions.ts, 1, 55))
new (s: string): {
>s : Symbol(s, Decl(taggedTemplateStringsWithManyCallAndMemberExpressions.ts, 3, 13))
@ -27,8 +28,8 @@ var f: I;
var x = new new new f `abc${ 0 }def`.member("hello")(42) === true;
>x : Symbol(x, Decl(taggedTemplateStringsWithManyCallAndMemberExpressions.ts, 12, 3))
>f `abc${ 0 }def`.member : Symbol(I.member, Decl(taggedTemplateStringsWithManyCallAndMemberExpressions.ts, 1, 43))
>f `abc${ 0 }def`.member : Symbol(I.member, Decl(taggedTemplateStringsWithManyCallAndMemberExpressions.ts, 1, 55))
>f : Symbol(f, Decl(taggedTemplateStringsWithManyCallAndMemberExpressions.ts, 10, 3))
>member : Symbol(I.member, Decl(taggedTemplateStringsWithManyCallAndMemberExpressions.ts, 1, 43))
>member : Symbol(I.member, Decl(taggedTemplateStringsWithManyCallAndMemberExpressions.ts, 1, 55))

View File

@ -2,8 +2,9 @@
interface I {
>I : I
(strs: string[], ...subs: number[]): I;
>strs : string[]
(strs: TemplateStringsArray, ...subs: number[]): I;
>strs : TemplateStringsArray
>TemplateStringsArray : TemplateStringsArray
>subs : number[]
>I : I

View File

@ -1,6 +1,6 @@
//// [taggedTemplateStringsWithManyCallAndMemberExpressionsES6.ts]
interface I {
(strs: string[], ...subs: number[]): I;
(strs: TemplateStringsArray, ...subs: number[]): I;
member: {
new (s: string): {
new (n: number): {

View File

@ -2,13 +2,14 @@
interface I {
>I : Symbol(I, Decl(taggedTemplateStringsWithManyCallAndMemberExpressionsES6.ts, 0, 0))
(strs: string[], ...subs: number[]): I;
(strs: TemplateStringsArray, ...subs: number[]): I;
>strs : Symbol(strs, Decl(taggedTemplateStringsWithManyCallAndMemberExpressionsES6.ts, 1, 5))
>subs : Symbol(subs, Decl(taggedTemplateStringsWithManyCallAndMemberExpressionsES6.ts, 1, 20))
>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --))
>subs : Symbol(subs, Decl(taggedTemplateStringsWithManyCallAndMemberExpressionsES6.ts, 1, 32))
>I : Symbol(I, Decl(taggedTemplateStringsWithManyCallAndMemberExpressionsES6.ts, 0, 0))
member: {
>member : Symbol(I.member, Decl(taggedTemplateStringsWithManyCallAndMemberExpressionsES6.ts, 1, 43))
>member : Symbol(I.member, Decl(taggedTemplateStringsWithManyCallAndMemberExpressionsES6.ts, 1, 55))
new (s: string): {
>s : Symbol(s, Decl(taggedTemplateStringsWithManyCallAndMemberExpressionsES6.ts, 3, 13))
@ -27,8 +28,8 @@ var f: I;
var x = new new new f `abc${ 0 }def`.member("hello")(42) === true;
>x : Symbol(x, Decl(taggedTemplateStringsWithManyCallAndMemberExpressionsES6.ts, 12, 3))
>f `abc${ 0 }def`.member : Symbol(I.member, Decl(taggedTemplateStringsWithManyCallAndMemberExpressionsES6.ts, 1, 43))
>f `abc${ 0 }def`.member : Symbol(I.member, Decl(taggedTemplateStringsWithManyCallAndMemberExpressionsES6.ts, 1, 55))
>f : Symbol(f, Decl(taggedTemplateStringsWithManyCallAndMemberExpressionsES6.ts, 10, 3))
>member : Symbol(I.member, Decl(taggedTemplateStringsWithManyCallAndMemberExpressionsES6.ts, 1, 43))
>member : Symbol(I.member, Decl(taggedTemplateStringsWithManyCallAndMemberExpressionsES6.ts, 1, 55))

View File

@ -2,8 +2,9 @@
interface I {
>I : I
(strs: string[], ...subs: number[]): I;
>strs : string[]
(strs: TemplateStringsArray, ...subs: number[]): I;
>strs : TemplateStringsArray
>TemplateStringsArray : TemplateStringsArray
>subs : number[]
>I : I

View File

@ -1,25 +1,39 @@
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(12,20): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(9,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
Property 'raw' is missing in type 'undefined[]'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(10,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(11,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(12,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(13,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(14,9): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(19,20): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts(21,9): error TS2346: Supplied parameters do not match any signature of call target.
==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts (4 errors) ====
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): {};
==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts (8 errors) ====
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;
}
var a = foo([]); // number
~~
!!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
!!! error TS2345: Property 'raw' is missing in type 'undefined[]'.
var b = foo([], 1); // string
~~
!!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
var c = foo([], 1, 2); // boolean
~~
!!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
var d = foo([], 1, true); // boolean (with error)
~~~~
!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'.
~~
!!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
var e = foo([], 1, "2"); // {}
~~
!!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
var f = foo([], 1, 2, 3); // any (with error)
~~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.

View File

@ -1,8 +1,8 @@
//// [taggedTemplateStringsWithOverloadResolution1.ts]
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;
}

View File

@ -1,25 +1,39 @@
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(12,20): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(9,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
Property 'raw' is missing in type 'undefined[]'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(10,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(11,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(12,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(13,13): error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(14,9): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(19,20): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'.
tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts(21,9): error TS2346: Supplied parameters do not match any signature of call target.
==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts (4 errors) ====
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): {};
==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts (8 errors) ====
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;
}
var a = foo([]); // number
~~
!!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
!!! error TS2345: Property 'raw' is missing in type 'undefined[]'.
var b = foo([], 1); // string
~~
!!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
var c = foo([], 1, 2); // boolean
~~
!!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
var d = foo([], 1, true); // boolean (with error)
~~~~
!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'.
~~
!!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
var e = foo([], 1, "2"); // {}
~~
!!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'.
var f = foo([], 1, 2, 3); // any (with error)
~~~~~~~~~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.

View File

@ -1,8 +1,8 @@
//// [taggedTemplateStringsWithOverloadResolution1_ES6.ts]
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;
}

View File

@ -6,8 +6,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;
@ -15,8 +15,8 @@ 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);
//// [taggedTemplateStringsWithOverloadResolution2.js]
function foo1() {
@ -26,8 +26,8 @@ function foo1() {
}
return undefined;
}
var a = (_a = ["", ""], _a.raw = ["", ""], foo1(_a, 1)); // string
var b = foo1([], 1); // number
var a = (_a = ["", ""], _a.raw = ["", ""], foo1(_a, 1));
var b = foo1([], 1);
function foo2() {
var stuff = [];
for (var _i = 0; _i < arguments.length; _i++) {
@ -35,6 +35,6 @@ function foo2() {
}
return undefined;
}
var c = (_b = ["", ""], _b.raw = ["", ""], foo2(_b, 1)); // number
var d = foo2([], 1); // number
var c = (_b = ["", ""], _b.raw = ["", ""], foo2(_b, 1));
var d = foo2([], 1);
var _a, _b;

View File

@ -19,11 +19,11 @@ function foo1(...stuff: any[]): any {
>undefined : Symbol(undefined)
}
var a = foo1 `${1}`; // string
var a = foo1 `${1}`;
>a : Symbol(a, Decl(taggedTemplateStringsWithOverloadResolution2.ts, 7, 3))
>foo1 : Symbol(foo1, Decl(taggedTemplateStringsWithOverloadResolution2.ts, 0, 0), Decl(taggedTemplateStringsWithOverloadResolution2.ts, 1, 61), Decl(taggedTemplateStringsWithOverloadResolution2.ts, 2, 49))
var b = foo1([], 1); // number
var b = foo1([], 1);
>b : Symbol(b, Decl(taggedTemplateStringsWithOverloadResolution2.ts, 8, 3))
>foo1 : Symbol(foo1, Decl(taggedTemplateStringsWithOverloadResolution2.ts, 0, 0), Decl(taggedTemplateStringsWithOverloadResolution2.ts, 1, 61), Decl(taggedTemplateStringsWithOverloadResolution2.ts, 2, 49))
@ -46,11 +46,11 @@ function foo2(...stuff: any[]): any {
>undefined : Symbol(undefined)
}
var c = foo2 `${1}`; // number
var c = foo2 `${1}`;
>c : Symbol(c, Decl(taggedTemplateStringsWithOverloadResolution2.ts, 16, 3))
>foo2 : Symbol(foo2, Decl(taggedTemplateStringsWithOverloadResolution2.ts, 8, 20), Decl(taggedTemplateStringsWithOverloadResolution2.ts, 10, 49), Decl(taggedTemplateStringsWithOverloadResolution2.ts, 11, 61))
var d = foo2([], 1); // number
var d = foo2([], 1);
>d : Symbol(d, Decl(taggedTemplateStringsWithOverloadResolution2.ts, 17, 3))
>foo2 : Symbol(foo2, Decl(taggedTemplateStringsWithOverloadResolution2.ts, 8, 20), Decl(taggedTemplateStringsWithOverloadResolution2.ts, 10, 49), Decl(taggedTemplateStringsWithOverloadResolution2.ts, 11, 61))

View File

@ -19,14 +19,14 @@ function foo1(...stuff: any[]): any {
>undefined : undefined
}
var a = foo1 `${1}`; // string
var a = foo1 `${1}`;
>a : string
>foo1 `${1}` : string
>foo1 : { (strs: TemplateStringsArray, x: number): string; (strs: string[], x: number): number; }
>`${1}` : string
>1 : number
var b = foo1([], 1); // number
var b = foo1([], 1);
>b : number
>foo1([], 1) : number
>foo1 : { (strs: TemplateStringsArray, x: number): string; (strs: string[], x: number): number; }
@ -52,14 +52,14 @@ function foo2(...stuff: any[]): any {
>undefined : undefined
}
var c = foo2 `${1}`; // number
>c : number
>foo2 `${1}` : number
var c = foo2 `${1}`;
>c : string
>foo2 `${1}` : string
>foo2 : { (strs: string[], x: number): number; (strs: TemplateStringsArray, x: number): string; }
>`${1}` : string
>1 : number
var d = foo2([], 1); // number
var d = foo2([], 1);
>d : number
>foo2([], 1) : number
>foo2 : { (strs: string[], x: number): number; (strs: TemplateStringsArray, x: number): string; }

View File

@ -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,17 +14,17 @@ 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);
//// [taggedTemplateStringsWithOverloadResolution2_ES6.js]
function foo1(...stuff) {
return undefined;
}
var a = foo1 `${1}`; // string
var b = foo1([], 1); // number
var a = foo1 `${1}`;
var b = foo1([], 1);
function foo2(...stuff) {
return undefined;
}
var c = foo2 `${1}`; // number
var d = foo2([], 1); // number
var c = foo2 `${1}`;
var d = foo2([], 1);

View File

@ -18,11 +18,11 @@ function foo1(...stuff: any[]): any {
>undefined : Symbol(undefined)
}
var a = foo1 `${1}`; // string
var a = foo1 `${1}`;
>a : Symbol(a, Decl(taggedTemplateStringsWithOverloadResolution2_ES6.ts, 6, 3))
>foo1 : Symbol(foo1, Decl(taggedTemplateStringsWithOverloadResolution2_ES6.ts, 0, 0), Decl(taggedTemplateStringsWithOverloadResolution2_ES6.ts, 0, 61), Decl(taggedTemplateStringsWithOverloadResolution2_ES6.ts, 1, 49))
var b = foo1([], 1); // number
var b = foo1([], 1);
>b : Symbol(b, Decl(taggedTemplateStringsWithOverloadResolution2_ES6.ts, 7, 3))
>foo1 : Symbol(foo1, Decl(taggedTemplateStringsWithOverloadResolution2_ES6.ts, 0, 0), Decl(taggedTemplateStringsWithOverloadResolution2_ES6.ts, 0, 61), Decl(taggedTemplateStringsWithOverloadResolution2_ES6.ts, 1, 49))
@ -45,11 +45,11 @@ function foo2(...stuff: any[]): any {
>undefined : Symbol(undefined)
}
var c = foo2 `${1}`; // number
var c = foo2 `${1}`;
>c : Symbol(c, Decl(taggedTemplateStringsWithOverloadResolution2_ES6.ts, 15, 3))
>foo2 : Symbol(foo2, Decl(taggedTemplateStringsWithOverloadResolution2_ES6.ts, 7, 20), Decl(taggedTemplateStringsWithOverloadResolution2_ES6.ts, 9, 49), Decl(taggedTemplateStringsWithOverloadResolution2_ES6.ts, 10, 61))
var d = foo2([], 1); // number
var d = foo2([], 1);
>d : Symbol(d, Decl(taggedTemplateStringsWithOverloadResolution2_ES6.ts, 16, 3))
>foo2 : Symbol(foo2, Decl(taggedTemplateStringsWithOverloadResolution2_ES6.ts, 7, 20), Decl(taggedTemplateStringsWithOverloadResolution2_ES6.ts, 9, 49), Decl(taggedTemplateStringsWithOverloadResolution2_ES6.ts, 10, 61))

View File

@ -18,14 +18,14 @@ function foo1(...stuff: any[]): any {
>undefined : undefined
}
var a = foo1 `${1}`; // string
var a = foo1 `${1}`;
>a : string
>foo1 `${1}` : string
>foo1 : { (strs: TemplateStringsArray, x: number): string; (strs: string[], x: number): number; }
>`${1}` : string
>1 : number
var b = foo1([], 1); // number
var b = foo1([], 1);
>b : number
>foo1([], 1) : number
>foo1 : { (strs: TemplateStringsArray, x: number): string; (strs: string[], x: number): number; }
@ -51,14 +51,14 @@ function foo2(...stuff: any[]): any {
>undefined : undefined
}
var c = foo2 `${1}`; // number
>c : number
>foo2 `${1}` : number
var c = foo2 `${1}`;
>c : string
>foo2 `${1}` : string
>foo2 : { (strs: string[], x: number): number; (strs: TemplateStringsArray, x: number): string; }
>`${1}` : string
>1 : number
var d = foo2([], 1); // number
var d = foo2([], 1);
>d : number
>foo2([], 1) : number
>foo2 : { (strs: string[], x: number): number; (strs: TemplateStringsArray, x: number): string; }

View File

@ -1,6 +1,6 @@
//// [taggedTemplateStringsWithTypedTags.ts]
interface I {
(stringParts: string[], ...rest: number[]): I;
(stringParts: TemplateStringsArray, ...rest: number[]): I;
g: I;
h: I;
member: I;

View File

@ -2,13 +2,14 @@
interface I {
>I : Symbol(I, Decl(taggedTemplateStringsWithTypedTags.ts, 0, 0))
(stringParts: string[], ...rest: number[]): I;
(stringParts: TemplateStringsArray, ...rest: number[]): I;
>stringParts : Symbol(stringParts, Decl(taggedTemplateStringsWithTypedTags.ts, 1, 5))
>rest : Symbol(rest, Decl(taggedTemplateStringsWithTypedTags.ts, 1, 27))
>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.d.ts, --, --))
>rest : Symbol(rest, Decl(taggedTemplateStringsWithTypedTags.ts, 1, 39))
>I : Symbol(I, Decl(taggedTemplateStringsWithTypedTags.ts, 0, 0))
g: I;
>g : Symbol(I.g, Decl(taggedTemplateStringsWithTypedTags.ts, 1, 50))
>g : Symbol(I.g, Decl(taggedTemplateStringsWithTypedTags.ts, 1, 62))
>I : Symbol(I, Decl(taggedTemplateStringsWithTypedTags.ts, 0, 0))
h: I;

View File

@ -2,8 +2,9 @@
interface I {
>I : I
(stringParts: string[], ...rest: number[]): I;
>stringParts : string[]
(stringParts: TemplateStringsArray, ...rest: number[]): I;
>stringParts : TemplateStringsArray
>TemplateStringsArray : TemplateStringsArray
>rest : number[]
>I : I

View File

@ -1,6 +1,6 @@
//// [taggedTemplateStringsWithTypedTagsES6.ts]
interface I {
(stringParts: string[], ...rest: number[]): I;
(stringParts: TemplateStringsArray, ...rest: number[]): I;
g: I;
h: I;
member: I;

View File

@ -2,13 +2,14 @@
interface I {
>I : Symbol(I, Decl(taggedTemplateStringsWithTypedTagsES6.ts, 0, 0))
(stringParts: string[], ...rest: number[]): I;
(stringParts: TemplateStringsArray, ...rest: number[]): I;
>stringParts : Symbol(stringParts, Decl(taggedTemplateStringsWithTypedTagsES6.ts, 1, 5))
>rest : Symbol(rest, Decl(taggedTemplateStringsWithTypedTagsES6.ts, 1, 27))
>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --))
>rest : Symbol(rest, Decl(taggedTemplateStringsWithTypedTagsES6.ts, 1, 39))
>I : Symbol(I, Decl(taggedTemplateStringsWithTypedTagsES6.ts, 0, 0))
g: I;
>g : Symbol(I.g, Decl(taggedTemplateStringsWithTypedTagsES6.ts, 1, 50))
>g : Symbol(I.g, Decl(taggedTemplateStringsWithTypedTagsES6.ts, 1, 62))
>I : Symbol(I, Decl(taggedTemplateStringsWithTypedTagsES6.ts, 0, 0))
h: I;

View File

@ -2,8 +2,9 @@
interface I {
>I : I
(stringParts: string[], ...rest: number[]): I;
>stringParts : string[]
(stringParts: TemplateStringsArray, ...rest: number[]): I;
>stringParts : TemplateStringsArray
>TemplateStringsArray : TemplateStringsArray
>rest : number[]
>I : I