@@ -368,7 +368,7 @@ namespace ts {
368368 return emitResolver;
369369 }
370370
371- function error(location: Node, message: DiagnosticMessage, arg0?: string, arg1?: string, arg2?: string): void {
371+ function error(location: Node, message: DiagnosticMessage, arg0?: string | number , arg1?: string | number , arg2?: string | number ): void {
372372 const diagnostic = location
373373 ? createDiagnosticForNode(location, message, arg0, arg1, arg2)
374374 : createCompilerDiagnostic(message, arg0, arg1, arg2);
@@ -3004,8 +3004,7 @@ namespace ts {
30043004 : elementType;
30053005 if (!type) {
30063006 if (isTupleType(parentType)) {
3007- error(declaration, Diagnostics.Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2,
3008- typeToString(parentType), getTypeReferenceArity(<TypeReference>parentType).toString(), pattern.elements.length.toString());
3007+ error(declaration, Diagnostics.Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2, typeToString(parentType), getTypeReferenceArity(<TypeReference>parentType), pattern.elements.length);
30093008 }
30103009 else {
30113010 error(declaration, Diagnostics.Type_0_has_no_property_1, typeToString(parentType), propName);
@@ -5104,7 +5103,7 @@ namespace ts {
51045103 const typeParameters = type.localTypeParameters;
51055104 if (typeParameters) {
51065105 if (!node.typeArguments || node.typeArguments.length !== typeParameters.length) {
5107- error(node, Diagnostics.Generic_type_0_requires_1_type_argument_s, typeToString(type, /*enclosingDeclaration*/ undefined, TypeFormatFlags.WriteArrayAsGenericType), typeParameters.length.toString() );
5106+ error(node, Diagnostics.Generic_type_0_requires_1_type_argument_s, typeToString(type, /*enclosingDeclaration*/ undefined, TypeFormatFlags.WriteArrayAsGenericType), typeParameters.length);
51085107 return unknownType;
51095108 }
51105109 // In a type reference, the outer type parameters of the referenced class or interface are automatically
@@ -5128,7 +5127,7 @@ namespace ts {
51285127 const typeParameters = links.typeParameters;
51295128 if (typeParameters) {
51305129 if (!node.typeArguments || node.typeArguments.length !== typeParameters.length) {
5131- error(node, Diagnostics.Generic_type_0_requires_1_type_argument_s, symbolToString(symbol), typeParameters.length.toString() );
5130+ error(node, Diagnostics.Generic_type_0_requires_1_type_argument_s, symbolToString(symbol), typeParameters.length);
51325131 return unknownType;
51335132 }
51345133 const typeArguments = map(node.typeArguments, getTypeFromTypeNodeNoAlias);
@@ -5271,7 +5270,7 @@ namespace ts {
52715270 return arity ? emptyGenericType : emptyObjectType;
52725271 }
52735272 if (((<InterfaceType>type).typeParameters ? (<InterfaceType>type).typeParameters.length : 0) !== arity) {
5274- error(getTypeDeclaration(symbol), Diagnostics.Global_type_0_must_have_1_type_parameter_s, symbol.name, arity.toString() );
5273+ error(getTypeDeclaration(symbol), Diagnostics.Global_type_0_must_have_1_type_parameter_s, symbol.name, arity);
52755274 return arity ? emptyGenericType : emptyObjectType;
52765275 }
52775276 return <ObjectType>type;
@@ -13631,8 +13630,7 @@ namespace ts {
1363113630 // such as NodeCheckFlags.LexicalThis on "this"expression.
1363213631 checkExpression(element);
1363313632 if (isTupleType(sourceType)) {
13634- error(element, Diagnostics.Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2,
13635- typeToString(sourceType), getTypeReferenceArity(<TypeReference>sourceType).toString(), elements.length.toString());
13633+ error(element, Diagnostics.Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2, typeToString(sourceType), getTypeReferenceArity(<TypeReference>sourceType), elements.length);
1363613634 }
1363713635 else {
1363813636 error(element, Diagnostics.Type_0_has_no_property_1, typeToString(sourceType), propName);
0 commit comments