Merge branch 'fixUnionTypeCallSignature' of https://github.com/erictsangx/TypeScript into erictsangx-fixUnionTypeCallSignature

This commit is contained in:
Mohamed Hegazy 2016-09-13 22:26:48 -07:00
commit 5367249e20
29 changed files with 75 additions and 74 deletions

1
.gitignore vendored
View file

@ -54,3 +54,4 @@ internal/
!tests/cases/projects/projectOption/**/node_modules
!tests/cases/projects/NodeModulesSearch/**/*
!tests/baselines/reference/project/nodeModules*/**/*
.idea

View file

@ -12096,7 +12096,7 @@ namespace ts {
error(node, Diagnostics.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new, typeToString(funcType));
}
else {
error(node, Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature);
error(node, Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures, typeToString(apparentType));
}
return resolveErrorCall(node);
}
@ -12258,7 +12258,7 @@ namespace ts {
}
if (!callSignatures.length) {
error(node, Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature);
error(node, Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures, typeToString(apparentType));
return resolveErrorCall(node);
}
@ -12306,7 +12306,7 @@ namespace ts {
const headMessage = getDiagnosticHeadMessageForDecoratorResolution(node);
if (!callSignatures.length) {
let errorInfo: DiagnosticMessageChain;
errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature);
errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures, typeToString(apparentType));
errorInfo = chainDiagnosticMessages(errorInfo, headMessage);
diagnostics.add(createDiagnosticForNodeFromMessageChain(node, errorInfo));
return resolveErrorCall(node);

View file

@ -1043,7 +1043,7 @@
"category": "Error",
"code": 2348
},
"Cannot invoke an expression whose type lacks a call signature.": {
"Cannot invoke an expression whose type lacks a call signature. Type '{0}' has no compatible call signatures.": {
"category": "Error",
"code": 2349
},

View file

@ -2,7 +2,7 @@ tests/cases/compiler/callOnInstance.ts(1,18): error TS2300: Duplicate identifier
tests/cases/compiler/callOnInstance.ts(3,15): error TS2300: Duplicate identifier 'D'.
tests/cases/compiler/callOnInstance.ts(7,19): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/callOnInstance.ts(7,19): error TS2350: Only a void function can be called with the 'new' keyword.
tests/cases/compiler/callOnInstance.ts(10,1): error TS2349: Cannot invoke an expression whose type lacks a call signature.
tests/cases/compiler/callOnInstance.ts(10,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'C' has no compatible call signatures.
==== tests/cases/compiler/callOnInstance.ts (5 errors) ====
@ -25,4 +25,4 @@ tests/cases/compiler/callOnInstance.ts(10,1): error TS2349: Cannot invoke an exp
declare class C { constructor(value: number); }
(new C(1))(); // Error for calling an instance
~~~~~~~~~~~~
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature.
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'C' has no compatible call signatures.

View file

@ -1,6 +1,6 @@
tests/cases/compiler/computedPropertiesInDestructuring1.ts(20,8): error TS2349: Cannot invoke an expression whose type lacks a call signature.
tests/cases/compiler/computedPropertiesInDestructuring1.ts(20,8): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'String' has no compatible call signatures.
tests/cases/compiler/computedPropertiesInDestructuring1.ts(21,12): error TS2339: Property 'toExponential' does not exist on type 'string'.
tests/cases/compiler/computedPropertiesInDestructuring1.ts(33,4): error TS2349: Cannot invoke an expression whose type lacks a call signature.
tests/cases/compiler/computedPropertiesInDestructuring1.ts(33,4): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'String' has no compatible call signatures.
tests/cases/compiler/computedPropertiesInDestructuring1.ts(34,5): error TS2365: Operator '+' cannot be applied to types '1' and '{}'.
@ -26,7 +26,7 @@ tests/cases/compiler/computedPropertiesInDestructuring1.ts(34,5): error TS2365:
// report errors on type errors in computed properties used in destructuring
let [{[foo()]: bar6}] = [{bar: "bar"}];
~~~~~
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature.
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'String' has no compatible call signatures.
let [{[foo.toExponential()]: bar7}] = [{bar: "bar"}];
~~~~~~~~~~~~~
!!! error TS2339: Property 'toExponential' does not exist on type 'string'.
@ -43,7 +43,7 @@ tests/cases/compiler/computedPropertiesInDestructuring1.ts(34,5): error TS2365:
[{[foo()]: bar4}] = [{bar: "bar"}];
~~~~~
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature.
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'String' has no compatible call signatures.
[{[(1 + {})]: bar4}] = [{bar: "bar"}];
~~~~~~
!!! error TS2365: Operator '+' cannot be applied to types '1' and '{}'.

View file

@ -1,6 +1,6 @@
tests/cases/compiler/computedPropertiesInDestructuring1_ES6.ts(21,8): error TS2349: Cannot invoke an expression whose type lacks a call signature.
tests/cases/compiler/computedPropertiesInDestructuring1_ES6.ts(21,8): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'String' has no compatible call signatures.
tests/cases/compiler/computedPropertiesInDestructuring1_ES6.ts(22,12): error TS2339: Property 'toExponential' does not exist on type 'string'.
tests/cases/compiler/computedPropertiesInDestructuring1_ES6.ts(34,4): error TS2349: Cannot invoke an expression whose type lacks a call signature.
tests/cases/compiler/computedPropertiesInDestructuring1_ES6.ts(34,4): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'String' has no compatible call signatures.
tests/cases/compiler/computedPropertiesInDestructuring1_ES6.ts(35,5): error TS2365: Operator '+' cannot be applied to types '1' and '{}'.
@ -27,7 +27,7 @@ tests/cases/compiler/computedPropertiesInDestructuring1_ES6.ts(35,5): error TS23
// report errors on type errors in computed properties used in destructuring
let [{[foo()]: bar6}] = [{bar: "bar"}];
~~~~~
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature.
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'String' has no compatible call signatures.
let [{[foo.toExponential()]: bar7}] = [{bar: "bar"}];
~~~~~~~~~~~~~
!!! error TS2339: Property 'toExponential' does not exist on type 'string'.
@ -44,7 +44,7 @@ tests/cases/compiler/computedPropertiesInDestructuring1_ES6.ts(35,5): error TS23
[{[foo()]: bar4}] = [{bar: "bar"}];
~~~~~
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature.
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'String' has no compatible call signatures.
[{[(1 + {})]: bar4}] = [{bar: "bar"}];
~~~~~~
!!! error TS2365: Operator '+' cannot be applied to types '1' and '{}'.

View file

@ -1,5 +1,5 @@
tests/cases/conformance/decorators/class/constructableDecoratorOnClass01.ts(4,1): error TS1238: Unable to resolve signature of class decorator when called as an expression.
Cannot invoke an expression whose type lacks a call signature.
Cannot invoke an expression whose type lacks a call signature. Type 'typeof CtorDtor' has no compatible call signatures.
==== tests/cases/conformance/decorators/class/constructableDecoratorOnClass01.ts (1 errors) ====
@ -9,7 +9,7 @@ tests/cases/conformance/decorators/class/constructableDecoratorOnClass01.ts(4,1)
@CtorDtor
~~~~~~~~~
!!! error TS1238: Unable to resolve signature of class decorator when called as an expression.
!!! error TS1238: Cannot invoke an expression whose type lacks a call signature.
!!! error TS1238: Cannot invoke an expression whose type lacks a call signature. Type 'typeof CtorDtor' has no compatible call signatures.
class C {
}

View file

@ -1,7 +1,7 @@
tests/cases/compiler/constructorOverloads4.ts(2,18): error TS2300: Duplicate identifier 'Function'.
tests/cases/compiler/constructorOverloads4.ts(5,21): error TS2300: Duplicate identifier 'Function'.
tests/cases/compiler/constructorOverloads4.ts(6,21): error TS2300: Duplicate identifier 'Function'.
tests/cases/compiler/constructorOverloads4.ts(10,1): error TS2349: Cannot invoke an expression whose type lacks a call signature.
tests/cases/compiler/constructorOverloads4.ts(10,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'Function' has no compatible call signatures.
tests/cases/compiler/constructorOverloads4.ts(11,1): error TS2348: Value of type 'typeof Function' is not callable. Did you mean to include 'new'?
@ -23,7 +23,7 @@ tests/cases/compiler/constructorOverloads4.ts(11,1): error TS2348: Value of type
(new M.Function("return 5"))();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature.
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'Function' has no compatible call signatures.
M.Function("yo");
~~~~~~~~~~~~~~~~
!!! error TS2348: Value of type 'typeof Function' is not callable. Did you mean to include 'new'?

View file

@ -1,4 +1,4 @@
tests/cases/compiler/functionExpressionShadowedByParams.ts(3,4): error TS2349: Cannot invoke an expression whose type lacks a call signature.
tests/cases/compiler/functionExpressionShadowedByParams.ts(3,4): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'Number' has no compatible call signatures.
tests/cases/compiler/functionExpressionShadowedByParams.ts(10,9): error TS2339: Property 'apply' does not exist on type 'number'.
@ -7,7 +7,7 @@ tests/cases/compiler/functionExpressionShadowedByParams.ts(10,9): error TS2339:
b1.toPrecision(2); // should not error
b1(12); // should error
~~~~~~
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature.
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'Number' has no compatible call signatures.
}

View file

@ -1,9 +1,9 @@
tests/cases/conformance/classes/members/classTypes/instancePropertiesInheritedIntoClassType.ts(4,13): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/classes/members/classTypes/instancePropertiesInheritedIntoClassType.ts(7,13): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/classes/members/classTypes/instancePropertiesInheritedIntoClassType.ts(19,14): error TS2349: Cannot invoke an expression whose type lacks a call signature.
tests/cases/conformance/classes/members/classTypes/instancePropertiesInheritedIntoClassType.ts(19,14): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'Number' has no compatible call signatures.
tests/cases/conformance/classes/members/classTypes/instancePropertiesInheritedIntoClassType.ts(26,13): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/classes/members/classTypes/instancePropertiesInheritedIntoClassType.ts(29,13): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/classes/members/classTypes/instancePropertiesInheritedIntoClassType.ts(41,14): error TS2349: Cannot invoke an expression whose type lacks a call signature.
tests/cases/conformance/classes/members/classTypes/instancePropertiesInheritedIntoClassType.ts(41,14): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'String' has no compatible call signatures.
==== tests/cases/conformance/classes/members/classTypes/instancePropertiesInheritedIntoClassType.ts (6 errors) ====
@ -31,7 +31,7 @@ tests/cases/conformance/classes/members/classTypes/instancePropertiesInheritedIn
r.y = 4;
var r6 = d.y(); // error
~~~~~
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature.
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'Number' has no compatible call signatures.
}
@ -59,5 +59,5 @@ tests/cases/conformance/classes/members/classTypes/instancePropertiesInheritedIn
r.y = '';
var r6 = d.y(); // error
~~~~~
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature.
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'String' has no compatible call signatures.
}

View file

@ -1,9 +1,9 @@
tests/cases/conformance/classes/members/classTypes/instancePropertyInClassType.ts(4,13): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/classes/members/classTypes/instancePropertyInClassType.ts(7,13): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/classes/members/classTypes/instancePropertyInClassType.ts(17,14): error TS2349: Cannot invoke an expression whose type lacks a call signature.
tests/cases/conformance/classes/members/classTypes/instancePropertyInClassType.ts(17,14): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'Number' has no compatible call signatures.
tests/cases/conformance/classes/members/classTypes/instancePropertyInClassType.ts(24,13): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/classes/members/classTypes/instancePropertyInClassType.ts(27,13): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/classes/members/classTypes/instancePropertyInClassType.ts(37,14): error TS2349: Cannot invoke an expression whose type lacks a call signature.
tests/cases/conformance/classes/members/classTypes/instancePropertyInClassType.ts(37,14): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'String' has no compatible call signatures.
==== tests/cases/conformance/classes/members/classTypes/instancePropertyInClassType.ts (6 errors) ====
@ -29,7 +29,7 @@ tests/cases/conformance/classes/members/classTypes/instancePropertyInClassType.t
r.y = 4;
var r6 = c.y(); // error
~~~~~
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature.
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'Number' has no compatible call signatures.
}
@ -55,5 +55,5 @@ tests/cases/conformance/classes/members/classTypes/instancePropertyInClassType.t
r.y = '';
var r6 = c.y(); // error
~~~~~
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature.
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'String' has no compatible call signatures.
}

View file

@ -1,5 +1,5 @@
tests/cases/conformance/types/any/narrowFromAnyWithTypePredicate.ts(22,7): error TS2339: Property 'method' does not exist on type '{}'.
tests/cases/conformance/types/any/narrowFromAnyWithTypePredicate.ts(23,5): error TS2349: Cannot invoke an expression whose type lacks a call signature.
tests/cases/conformance/types/any/narrowFromAnyWithTypePredicate.ts(23,5): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '{}' has no compatible call signatures.
tests/cases/conformance/types/any/narrowFromAnyWithTypePredicate.ts(28,7): error TS2339: Property 'mesage' does not exist on type 'Error'.
tests/cases/conformance/types/any/narrowFromAnyWithTypePredicate.ts(33,7): error TS2339: Property 'getHuors' does not exist on type 'Date'.
@ -31,7 +31,7 @@ tests/cases/conformance/types/any/narrowFromAnyWithTypePredicate.ts(33,7): error
!!! error TS2339: Property 'method' does not exist on type '{}'.
x();
~~~
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature.
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '{}' has no compatible call signatures.
}
if (isError(x)) {

View file

@ -40,7 +40,7 @@ tests/cases/compiler/strictModeReservedWord.ts(22,22): error TS1212: Identifier
tests/cases/compiler/strictModeReservedWord.ts(22,30): error TS1212: Identifier expected. 'implements' is a reserved word in strict mode
tests/cases/compiler/strictModeReservedWord.ts(23,5): error TS2304: Cannot find name 'ublic'.
tests/cases/compiler/strictModeReservedWord.ts(24,5): error TS1212: Identifier expected. 'static' is a reserved word in strict mode
tests/cases/compiler/strictModeReservedWord.ts(24,5): error TS2349: Cannot invoke an expression whose type lacks a call signature.
tests/cases/compiler/strictModeReservedWord.ts(24,5): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'String' has no compatible call signatures.
==== tests/cases/compiler/strictModeReservedWord.ts (43 errors) ====
@ -153,7 +153,7 @@ tests/cases/compiler/strictModeReservedWord.ts(24,5): error TS2349: Cannot invok
~~~~~~
!!! error TS1212: Identifier expected. 'static' is a reserved word in strict mode
~~~~~~~~
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature.
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'String' has no compatible call signatures.
}

View file

@ -1,4 +1,4 @@
tests/cases/conformance/expressions/contextualTyping/superCallParameterContextualTyping2.ts(10,43): error TS2349: Cannot invoke an expression whose type lacks a call signature.
tests/cases/conformance/expressions/contextualTyping/superCallParameterContextualTyping2.ts(10,43): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'Number' has no compatible call signatures.
==== tests/cases/conformance/expressions/contextualTyping/superCallParameterContextualTyping2.ts (1 errors) ====
@ -13,5 +13,5 @@ tests/cases/conformance/expressions/contextualTyping/superCallParameterContextua
// Ensure 'value' is not of type 'any' by invoking it with type arguments.
constructor() { super(value => String(value<string>())); }
~~~~~~~~~~~~~~~
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature.
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'Number' has no compatible call signatures.
}

View file

@ -1,4 +1,4 @@
tests/cases/conformance/es6/templates/taggedTemplateWithConstructableTag01.ts(3,1): error TS2349: Cannot invoke an expression whose type lacks a call signature.
tests/cases/conformance/es6/templates/taggedTemplateWithConstructableTag01.ts(3,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'typeof CtorTag' has no compatible call signatures.
==== tests/cases/conformance/es6/templates/taggedTemplateWithConstructableTag01.ts (1 errors) ====
@ -6,4 +6,4 @@ tests/cases/conformance/es6/templates/taggedTemplateWithConstructableTag01.ts(3,
CtorTag `Hello world!`;
~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature.
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'typeof CtorTag' has no compatible call signatures.

View file

@ -1,4 +1,4 @@
tests/cases/conformance/es6/templates/taggedTemplateWithConstructableTag02.ts(6,1): error TS2349: Cannot invoke an expression whose type lacks a call signature.
tests/cases/conformance/es6/templates/taggedTemplateWithConstructableTag02.ts(6,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'I' has no compatible call signatures.
==== tests/cases/conformance/es6/templates/taggedTemplateWithConstructableTag02.ts (1 errors) ====
@ -9,4 +9,4 @@ tests/cases/conformance/es6/templates/taggedTemplateWithConstructableTag02.ts(6,
var tag: I;
tag `Hello world!`;
~~~~~~~~~~~~~~~~~~
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature.
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'I' has no compatible call signatures.

View file

@ -1,7 +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,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'String' has no compatible call signatures.
==== 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.
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'String' has no compatible call signatures.

View file

@ -1,7 +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,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'String' has no compatible call signatures.
==== 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.
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'String' has no compatible call signatures.

View file

@ -1,4 +1,4 @@
tests/cases/conformance/es6/templates/templateStringInObjectLiteral.ts(1,9): error TS2349: Cannot invoke an expression whose type lacks a call signature.
tests/cases/conformance/es6/templates/templateStringInObjectLiteral.ts(1,9): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '{ a: string; }' has no compatible call signatures.
tests/cases/conformance/es6/templates/templateStringInObjectLiteral.ts(3,5): error TS1136: Property assignment expected.
tests/cases/conformance/es6/templates/templateStringInObjectLiteral.ts(3,8): error TS1005: ',' expected.
tests/cases/conformance/es6/templates/templateStringInObjectLiteral.ts(3,10): error TS1134: Variable declaration expected.
@ -12,7 +12,7 @@ tests/cases/conformance/es6/templates/templateStringInObjectLiteral.ts(4,1): err
~~~~~~~~~~~~~~~~~~~~~~~~
`b`: 321
~~~~~~~
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature.
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '{ a: string; }' has no compatible call signatures.
~~~
!!! error TS1136: Property assignment expected.
~

View file

@ -1,4 +1,4 @@
tests/cases/conformance/es6/templates/templateStringInObjectLiteralES6.ts(1,9): error TS2349: Cannot invoke an expression whose type lacks a call signature.
tests/cases/conformance/es6/templates/templateStringInObjectLiteralES6.ts(1,9): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '{ a: string; }' has no compatible call signatures.
tests/cases/conformance/es6/templates/templateStringInObjectLiteralES6.ts(3,5): error TS1136: Property assignment expected.
tests/cases/conformance/es6/templates/templateStringInObjectLiteralES6.ts(3,8): error TS1005: ',' expected.
tests/cases/conformance/es6/templates/templateStringInObjectLiteralES6.ts(3,10): error TS1134: Variable declaration expected.
@ -12,7 +12,7 @@ tests/cases/conformance/es6/templates/templateStringInObjectLiteralES6.ts(4,1):
~~~~~~~~~~~~~~~~~~~~~~~~
`b`: 321
~~~~~~~
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature.
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '{ a: string; }' has no compatible call signatures.
~~~
!!! error TS1136: Property assignment expected.
~

View file

@ -1,4 +1,4 @@
tests/cases/conformance/es6/templates/templateStringInPropertyName1.ts(1,9): error TS2349: Cannot invoke an expression whose type lacks a call signature.
tests/cases/conformance/es6/templates/templateStringInPropertyName1.ts(1,9): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '{}' has no compatible call signatures.
tests/cases/conformance/es6/templates/templateStringInPropertyName1.ts(2,5): error TS1136: Property assignment expected.
tests/cases/conformance/es6/templates/templateStringInPropertyName1.ts(2,8): error TS1005: ',' expected.
tests/cases/conformance/es6/templates/templateStringInPropertyName1.ts(2,10): error TS1134: Variable declaration expected.
@ -10,7 +10,7 @@ tests/cases/conformance/es6/templates/templateStringInPropertyName1.ts(3,1): err
~
`a`: 321
~~~~~~~
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature.
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '{}' has no compatible call signatures.
~~~
!!! error TS1136: Property assignment expected.
~

View file

@ -1,4 +1,4 @@
tests/cases/conformance/es6/templates/templateStringInPropertyName2.ts(1,9): error TS2349: Cannot invoke an expression whose type lacks a call signature.
tests/cases/conformance/es6/templates/templateStringInPropertyName2.ts(1,9): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '{}' has no compatible call signatures.
tests/cases/conformance/es6/templates/templateStringInPropertyName2.ts(2,5): error TS1136: Property assignment expected.
tests/cases/conformance/es6/templates/templateStringInPropertyName2.ts(2,32): error TS1005: ',' expected.
tests/cases/conformance/es6/templates/templateStringInPropertyName2.ts(2,34): error TS1134: Variable declaration expected.
@ -10,7 +10,7 @@ tests/cases/conformance/es6/templates/templateStringInPropertyName2.ts(3,1): err
~
`abc${ 123 }def${ 456 }ghi`: 321
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature.
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '{}' has no compatible call signatures.
~~~~~~
!!! error TS1136: Property assignment expected.
~

View file

@ -1,4 +1,4 @@
tests/cases/conformance/es6/templates/templateStringInPropertyNameES6_1.ts(1,9): error TS2349: Cannot invoke an expression whose type lacks a call signature.
tests/cases/conformance/es6/templates/templateStringInPropertyNameES6_1.ts(1,9): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '{}' has no compatible call signatures.
tests/cases/conformance/es6/templates/templateStringInPropertyNameES6_1.ts(2,5): error TS1136: Property assignment expected.
tests/cases/conformance/es6/templates/templateStringInPropertyNameES6_1.ts(2,8): error TS1005: ',' expected.
tests/cases/conformance/es6/templates/templateStringInPropertyNameES6_1.ts(2,10): error TS1134: Variable declaration expected.
@ -10,7 +10,7 @@ tests/cases/conformance/es6/templates/templateStringInPropertyNameES6_1.ts(3,1):
~
`a`: 321
~~~~~~~
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature.
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '{}' has no compatible call signatures.
~~~
!!! error TS1136: Property assignment expected.
~

View file

@ -1,4 +1,4 @@
tests/cases/conformance/es6/templates/templateStringInPropertyNameES6_2.ts(1,9): error TS2349: Cannot invoke an expression whose type lacks a call signature.
tests/cases/conformance/es6/templates/templateStringInPropertyNameES6_2.ts(1,9): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '{}' has no compatible call signatures.
tests/cases/conformance/es6/templates/templateStringInPropertyNameES6_2.ts(2,5): error TS1136: Property assignment expected.
tests/cases/conformance/es6/templates/templateStringInPropertyNameES6_2.ts(2,32): error TS1005: ',' expected.
tests/cases/conformance/es6/templates/templateStringInPropertyNameES6_2.ts(2,34): error TS1134: Variable declaration expected.
@ -10,7 +10,7 @@ tests/cases/conformance/es6/templates/templateStringInPropertyNameES6_2.ts(3,1):
~
`abc${ 123 }def${ 456 }ghi`: 321
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature.
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '{}' has no compatible call signatures.
~~~~~~
!!! error TS1136: Property assignment expected.
~

View file

@ -1,7 +1,7 @@
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(1,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'String' has no compatible call signatures.
==== tests/cases/conformance/es6/templates/templateStringInTaggedTemplate.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.
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'String' has no compatible call signatures.

View file

@ -1,7 +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,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'String' has no compatible call signatures.
==== 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.
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'String' has no compatible call signatures.

View file

@ -2,14 +2,14 @@ tests/cases/conformance/types/union/unionTypeCallSignatures.ts(9,43): error TS23
tests/cases/conformance/types/union/unionTypeCallSignatures.ts(10,29): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'.
tests/cases/conformance/types/union/unionTypeCallSignatures.ts(15,29): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'.
tests/cases/conformance/types/union/unionTypeCallSignatures.ts(16,1): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/types/union/unionTypeCallSignatures.ts(19,1): error TS2349: Cannot invoke an expression whose type lacks a call signature.
tests/cases/conformance/types/union/unionTypeCallSignatures.ts(20,1): error TS2349: Cannot invoke an expression whose type lacks a call signature.
tests/cases/conformance/types/union/unionTypeCallSignatures.ts(21,1): error TS2349: Cannot invoke an expression whose type lacks a call signature.
tests/cases/conformance/types/union/unionTypeCallSignatures.ts(19,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((a: number) => number) | ((a: string) => Date)' has no compatible call signatures.
tests/cases/conformance/types/union/unionTypeCallSignatures.ts(20,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((a: number) => number) | ((a: string) => Date)' has no compatible call signatures.
tests/cases/conformance/types/union/unionTypeCallSignatures.ts(21,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((a: number) => number) | ((a: string) => Date)' has no compatible call signatures.
tests/cases/conformance/types/union/unionTypeCallSignatures.ts(24,1): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/types/union/unionTypeCallSignatures.ts(26,36): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'.
tests/cases/conformance/types/union/unionTypeCallSignatures.ts(29,1): error TS2349: Cannot invoke an expression whose type lacks a call signature.
tests/cases/conformance/types/union/unionTypeCallSignatures.ts(30,1): error TS2349: Cannot invoke an expression whose type lacks a call signature.
tests/cases/conformance/types/union/unionTypeCallSignatures.ts(31,1): error TS2349: Cannot invoke an expression whose type lacks a call signature.
tests/cases/conformance/types/union/unionTypeCallSignatures.ts(29,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((a: string) => string) | ((a: string, b: number) => number)' has no compatible call signatures.
tests/cases/conformance/types/union/unionTypeCallSignatures.ts(30,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((a: string) => string) | ((a: string, b: number) => number)' has no compatible call signatures.
tests/cases/conformance/types/union/unionTypeCallSignatures.ts(31,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((a: string) => string) | ((a: string, b: number) => number)' has no compatible call signatures.
tests/cases/conformance/types/union/unionTypeCallSignatures.ts(36,49): error TS2345: Argument of type '"hello"' is not assignable to parameter of type 'number'.
tests/cases/conformance/types/union/unionTypeCallSignatures.ts(37,12): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/conformance/types/union/unionTypeCallSignatures.ts(40,12): error TS2346: Supplied parameters do not match any signature of call target.
@ -60,13 +60,13 @@ tests/cases/conformance/types/union/unionTypeCallSignatures.ts(73,12): error TS2
var unionOfDifferentParameterTypes: { (a: number): number; } | { (a: string): Date; };
unionOfDifferentParameterTypes(10);// error - no call signatures
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature.
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((a: number) => number) | ((a: string) => Date)' has no compatible call signatures.
unionOfDifferentParameterTypes("hello");// error - no call signatures
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature.
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((a: number) => number) | ((a: string) => Date)' has no compatible call signatures.
unionOfDifferentParameterTypes();// error - no call signatures
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature.
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((a: number) => number) | ((a: string) => Date)' has no compatible call signatures.
var unionOfDifferentNumberOfSignatures: { (a: number): number; } | { (a: number): Date; (a: string): boolean; };
unionOfDifferentNumberOfSignatures(); // error - no call signatures
@ -80,13 +80,13 @@ tests/cases/conformance/types/union/unionTypeCallSignatures.ts(73,12): error TS2
var unionWithDifferentParameterCount: { (a: string): string; } | { (a: string, b: number): number; } ;
unionWithDifferentParameterCount();// no call signature
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature.
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((a: string) => string) | ((a: string, b: number) => number)' has no compatible call signatures.
unionWithDifferentParameterCount("hello");// no call signature
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature.
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((a: string) => string) | ((a: string, b: number) => number)' has no compatible call signatures.
unionWithDifferentParameterCount("hello", 10);// no call signature
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature.
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((a: string) => string) | ((a: string, b: number) => number)' has no compatible call signatures.
var unionWithOptionalParameter1: { (a: string, b?: number): string; } | { (a: string, b?: number): number; };
strOrNum = unionWithOptionalParameter1('hello');

View file

@ -1,4 +1,4 @@
tests/cases/conformance/types/union/unionTypeMembers.ts(44,1): error TS2349: Cannot invoke an expression whose type lacks a call signature.
tests/cases/conformance/types/union/unionTypeMembers.ts(44,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((a: string) => string) | ((a: number) => number)' has no compatible call signatures.
tests/cases/conformance/types/union/unionTypeMembers.ts(51,3): error TS2339: Property 'propertyOnlyInI1' does not exist on type 'I1<number> | I2<number>'.
Property 'propertyOnlyInI1' does not exist on type 'I2<number>'.
tests/cases/conformance/types/union/unionTypeMembers.ts(52,3): error TS2339: Property 'propertyOnlyInI2' does not exist on type 'I1<number> | I2<number>'.
@ -55,7 +55,7 @@ tests/cases/conformance/types/union/unionTypeMembers.ts(54,3): error TS2339: Pro
x.commonMethodDifferentParameterType; // No error - property exists
x.commonMethodDifferentParameterType(strOrNum); // error - no call signatures because the type of this property is ((a: string) => string) | (a: number) => number
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature.
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((a: string) => string) | ((a: number) => number)' has no compatible call signatures.
// and the call signatures arent identical
num = x.commonMethodWithTypeParameter(num);
num = x.commonMethodWithOwnTypeParameter(num);

View file

@ -3,7 +3,7 @@ tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(5,10): error TS2
tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(8,10): error TS2347: Untyped function calls may not accept type arguments.
tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(10,7): error TS2420: Class 'C' incorrectly implements interface 'Function'.
Property 'apply' is missing in type 'C'.
tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(18,10): error TS2349: Cannot invoke an expression whose type lacks a call signature.
tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(18,10): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'C' has no compatible call signatures.
tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(22,10): error TS2347: Untyped function calls may not accept type arguments.
tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(28,10): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(35,1): error TS2346: Supplied parameters do not match any signature of call target.
@ -39,7 +39,7 @@ tests/cases/compiler/untypedFunctionCallsWithTypeParameters1.ts(41,1): error TS2
var c2: C;
var r4 = c2<number>(); // should be an error
~~~~~~~~~~~~
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature.
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'C' has no compatible call signatures.
class C2 extends Function { } // error
var c3: C2;