tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(7,21): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(10,5): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(16,20): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(17,20): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(23,5): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(26,5): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(34,13): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(35,13): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(36,13): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(40,13): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(41,13): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(42,13): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(45,5): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(54,5): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(55,5): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(56,5): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(57,5): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(60,5): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(63,5): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(64,5): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(70,5): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(71,5): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(10,9): error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(19,4): error TS2339: Property 'foo' does not exist on type 'Date'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(45,1): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(63,9): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'number'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(64,18): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts(70,18): error TS2339: Property 'toFixed' does not exist on type 'string'. ==== tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution3.ts (28 errors) ==== // Ambiguous call picks the first overload in declaration order function fn1(strs: TemplateStringsArray, s: string): string; function fn1(strs: TemplateStringsArray, n: number): number; function fn1() { return null; } var s: string = fn1 `${ undefined }`; ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. // No candidate overloads found fn1 `${ {} }`; // Error ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~~ !!! error TS2345: Argument of type '{}' is not assignable to parameter of type 'number'. function fn2(strs: TemplateStringsArray, s: string, n: number): number; function fn2(strs: TemplateStringsArray, n: number, t: T): T; function fn2() { return undefined; } var d1: Date = fn2 `${ 0 }${ undefined }`; // contextually typed ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. var d2 = fn2 `${ 0 }${ undefined }`; // any ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. d1.foo(); // error ~~~ !!! error TS2339: Property 'foo' does not exist on type 'Date'. d2(); // no error (typed as any) // Generic and non-generic overload where generic overload is the only candidate fn2 `${ 0 }${ '' }`; // OK ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. // Generic and non-generic overload where non-generic overload is the only candidate fn2 `${ '' }${ 0 }`; // OK ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. // Generic overloads with differing arity function fn3(strs: TemplateStringsArray, n: T): string; function fn3(strs: TemplateStringsArray, s: string, t: T, u: U): U; function fn3(strs: TemplateStringsArray, v: V, u: U, t: T): number; function fn3() { return null; } var s = fn3 `${ 3 }`; ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. var s = fn3 `${'' }${ 3 }${ '' }`; ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. var n = fn3 `${ 5 }${ 5 }${ 5 }`; ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. var n: number; // Generic overloads with differing arity tagging with arguments matching each overload type parameter count var s = fn3 `${ 4 }` ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. var s = fn3 `${ '' }${ '' }${ '' }`; ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. var n = fn3 `${ '' }${ '' }${ 3 }`; ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. // Generic overloads with differing arity tagging with argument count that doesn't match any overload fn3 ``; // Error ~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~~~~~~ !!! error TS2346: Supplied parameters do not match any signature of call target. // Generic overloads with constraints function fn4(strs: TemplateStringsArray, n: T, m: U); function fn4(strs: TemplateStringsArray, n: T, m: U); function fn4(strs: TemplateStringsArray) function fn4() { } // Generic overloads with constraints tagged with types that satisfy the constraints fn4 `${ '' }${ 3 }`; ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. fn4 `${ 3 }${ '' }`; ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. fn4 `${ 3 }${ undefined }`; ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. fn4 `${ '' }${ null }`; ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. // Generic overloads with constraints called with type arguments that do not satisfy the constraints fn4 `${ null }${ null }`; // Error ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints fn4 `${ true }${ null }`; ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~~~~ !!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'number'. fn4 `${ null }${ true }`; ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~~~~ !!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string'. // Non - generic overloads where contextual typing of function arguments has errors function fn5(strs: TemplateStringsArray, f: (n: string) => void): string; function fn5(strs: TemplateStringsArray, f: (n: number) => void): number; function fn5() { return undefined; } fn5 `${ (n) => n.toFixed() }`; // will error; 'n' should have type 'string'. ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher. ~~~~~~~ !!! error TS2339: Property 'toFixed' does not exist on type 'string'. fn5 `${ (n) => n.substr(0) }`; ~~~ !!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher.