mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-30 11:24:49 -05:00
Fixed issue where template expression in call expressions would emit with unnecessary parentheses.
Fixes #1205.
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
tests/cases/compiler/amdModuleName2.ts(2,1): error TS2458: An AMD module cannot have multiple name assignments.
|
||||
|
||||
|
||||
==== tests/cases/compiler/amdModuleName2.ts (1 errors) ====
|
||||
///<amd-module name='FirstModuleName'/>
|
||||
///<amd-module name='SecondModuleName'/>
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2458: An AMD module cannot have multiple name assignments.
|
||||
class Foo {
|
||||
x: number;
|
||||
constructor() {
|
||||
this.x = 5;
|
||||
}
|
||||
}
|
||||
export = Foo;
|
||||
tests/cases/compiler/amdModuleName2.ts(2,1): error TS2458: An AMD module cannot have multiple name assignments.
|
||||
|
||||
|
||||
==== tests/cases/compiler/amdModuleName2.ts (1 errors) ====
|
||||
///<amd-module name='FirstModuleName'/>
|
||||
///<amd-module name='SecondModuleName'/>
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2458: An AMD module cannot have multiple name assignments.
|
||||
class Foo {
|
||||
x: number;
|
||||
constructor() {
|
||||
this.x = 5;
|
||||
}
|
||||
}
|
||||
export = Foo;
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
tests/cases/conformance/es6/templates/templateStringInCallExpression.ts(1,1): error TS2349: Cannot invoke an expression whose type lacks a call signature.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/templates/templateStringInCallExpression.ts (1 errors) ====
|
||||
`abc${0}abc`(`hello ${0} world`, ` `, `1${2}3`);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature.
|
||||
@@ -0,0 +1,5 @@
|
||||
//// [templateStringInCallExpression.ts]
|
||||
`abc${0}abc`(`hello ${0} world`, ` `, `1${2}3`);
|
||||
|
||||
//// [templateStringInCallExpression.js]
|
||||
("abc" + 0 + "abc")("hello " + 0 + " world", " ", "1" + 2 + "3");
|
||||
@@ -0,0 +1,7 @@
|
||||
tests/cases/conformance/es6/templates/templateStringInCallExpressionES6.ts(1,1): error TS2349: Cannot invoke an expression whose type lacks a call signature.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/templates/templateStringInCallExpressionES6.ts (1 errors) ====
|
||||
`abc${0}abc`(`hello ${0} world`, ` `, `1${2}3`);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature.
|
||||
@@ -0,0 +1,5 @@
|
||||
//// [templateStringInCallExpressionES6.ts]
|
||||
`abc${0}abc`(`hello ${0} world`, ` `, `1${2}3`);
|
||||
|
||||
//// [templateStringInCallExpressionES6.js]
|
||||
`abc${0}abc`(`hello ${0} world`, ` `, `1${2}3`);
|
||||
@@ -0,0 +1,7 @@
|
||||
tests/cases/conformance/es6/templates/templateStringInNewExpression.ts(1,1): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/templates/templateStringInNewExpression.ts (1 errors) ====
|
||||
new `abc${0}abc`(`hello ${0} world`, ` `, `1${2}3`);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
|
||||
@@ -0,0 +1,5 @@
|
||||
//// [templateStringInNewExpression.ts]
|
||||
new `abc${0}abc`(`hello ${0} world`, ` `, `1${2}3`);
|
||||
|
||||
//// [templateStringInNewExpression.js]
|
||||
new ("abc" + 0 + "abc")("hello " + 0 + " world", " ", "1" + 2 + "3");
|
||||
@@ -0,0 +1,7 @@
|
||||
tests/cases/conformance/es6/templates/templateStringInNewExpressionES6.ts(1,1): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/templates/templateStringInNewExpressionES6.ts (1 errors) ====
|
||||
new `abc${0}abc`(`hello ${0} world`, ` `, `1${2}3`);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
|
||||
@@ -0,0 +1,5 @@
|
||||
//// [templateStringInNewExpressionES6.ts]
|
||||
new `abc${0}abc`(`hello ${0} world`, ` `, `1${2}3`);
|
||||
|
||||
//// [templateStringInNewExpressionES6.js]
|
||||
new `abc${0}abc`(`hello ${0} world`, ` `, `1${2}3`);
|
||||
@@ -0,0 +1,10 @@
|
||||
tests/cases/conformance/es6/templates/templateStringInTaggedTemplate.ts(1,1): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher.
|
||||
tests/cases/conformance/es6/templates/templateStringInTaggedTemplate.ts(1,1): error TS2349: Cannot invoke an expression whose type lacks a call signature.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/templates/templateStringInTaggedTemplate.ts (2 errors) ====
|
||||
`I AM THE ${ `${ `TAG` } ` } PORTION` `I ${ "AM" } THE TEMPLATE PORTION`
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher.
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature.
|
||||
@@ -0,0 +1,7 @@
|
||||
tests/cases/conformance/es6/templates/templateStringInTaggedTemplateES6.ts(1,1): error TS2349: Cannot invoke an expression whose type lacks a call signature.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/templates/templateStringInTaggedTemplateES6.ts (1 errors) ====
|
||||
`I AM THE ${ `${ `TAG` } ` } PORTION` `I ${ "AM" } THE TEMPLATE PORTION`
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature.
|
||||
@@ -0,0 +1,5 @@
|
||||
//// [templateStringInTaggedTemplateES6.ts]
|
||||
`I AM THE ${ `${ `TAG` } ` } PORTION` `I ${ "AM" } THE TEMPLATE PORTION`
|
||||
|
||||
//// [templateStringInTaggedTemplateES6.js]
|
||||
`I AM THE ${`${`TAG`} `} PORTION` `I ${"AM"} THE TEMPLATE PORTION`;
|
||||
@@ -0,0 +1 @@
|
||||
`abc${0}abc`(`hello ${0} world`, ` `, `1${2}3`);
|
||||
@@ -0,0 +1,2 @@
|
||||
// @target: ES6
|
||||
`abc${0}abc`(`hello ${0} world`, ` `, `1${2}3`);
|
||||
@@ -0,0 +1 @@
|
||||
new `abc${0}abc`(`hello ${0} world`, ` `, `1${2}3`);
|
||||
@@ -0,0 +1,2 @@
|
||||
// @target: ES6
|
||||
new `abc${0}abc`(`hello ${0} world`, ` `, `1${2}3`);
|
||||
@@ -0,0 +1 @@
|
||||
`I AM THE ${ `${ `TAG` } ` } PORTION` `I ${ "AM" } THE TEMPLATE PORTION`
|
||||
@@ -0,0 +1,2 @@
|
||||
// @target: ES6
|
||||
`I AM THE ${ `${ `TAG` } ` } PORTION` `I ${ "AM" } THE TEMPLATE PORTION`
|
||||
Reference in New Issue
Block a user