mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-17 21:09:09 -05:00
Merge branch 'master' into convert-to-named-parameters
This commit is contained in:
@@ -24448,7 +24448,10 @@ namespace ts {
|
||||
const bodySignature = getSignatureFromDeclaration(bodyDeclaration);
|
||||
for (const signature of signatures) {
|
||||
if (!isImplementationCompatibleWithOverload(bodySignature, signature)) {
|
||||
error(signature.declaration, Diagnostics.Overload_signature_is_not_compatible_with_function_implementation);
|
||||
addRelatedInfo(
|
||||
error(signature.declaration, Diagnostics.This_overload_signature_is_not_compatible_with_its_implementation_signature),
|
||||
createDiagnosticForNode(bodyDeclaration, Diagnostics.The_implementation_signature_is_declared_here)
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1404,7 +1404,7 @@
|
||||
"category": "Error",
|
||||
"code": 2393
|
||||
},
|
||||
"Overload signature is not compatible with function implementation.": {
|
||||
"This overload signature is not compatible with its implementation signature.": {
|
||||
"category": "Error",
|
||||
"code": 2394
|
||||
},
|
||||
@@ -2585,6 +2585,10 @@
|
||||
"category": "Error",
|
||||
"code": 2749
|
||||
},
|
||||
"The implementation signature is declared here.": {
|
||||
"category": "Error",
|
||||
"code": 2750
|
||||
},
|
||||
|
||||
"Import declaration '{0}' is using private name '{1}'.": {
|
||||
"category": "Error",
|
||||
|
||||
@@ -89,10 +89,10 @@ namespace ts {
|
||||
return createLiteralFromNode(value);
|
||||
}
|
||||
|
||||
export function createNumericLiteral(value: string): NumericLiteral {
|
||||
export function createNumericLiteral(value: string, numericLiteralFlags: TokenFlags = TokenFlags.None): NumericLiteral {
|
||||
const node = <NumericLiteral>createSynthesizedNode(SyntaxKind.NumericLiteral);
|
||||
node.text = value;
|
||||
node.numericLiteralFlags = 0;
|
||||
node.numericLiteralFlags = numericLiteralFlags;
|
||||
return node;
|
||||
}
|
||||
|
||||
|
||||
@@ -1648,20 +1648,26 @@ namespace ts {
|
||||
kind: SyntaxKind.NoSubstitutionTemplateLiteral;
|
||||
}
|
||||
|
||||
/* @internal */
|
||||
export const enum TokenFlags {
|
||||
None = 0,
|
||||
/* @internal */
|
||||
PrecedingLineBreak = 1 << 0,
|
||||
/* @internal */
|
||||
PrecedingJSDocComment = 1 << 1,
|
||||
/* @internal */
|
||||
Unterminated = 1 << 2,
|
||||
/* @internal */
|
||||
ExtendedUnicodeEscape = 1 << 3,
|
||||
Scientific = 1 << 4, // e.g. `10e2`
|
||||
Octal = 1 << 5, // e.g. `0777`
|
||||
HexSpecifier = 1 << 6, // e.g. `0x00000000`
|
||||
BinarySpecifier = 1 << 7, // e.g. `0b0110010000000000`
|
||||
OctalSpecifier = 1 << 8, // e.g. `0o777`
|
||||
/* @internal */
|
||||
ContainsSeparator = 1 << 9, // e.g. `0b1100_0101`
|
||||
/* @internal */
|
||||
BinaryOrOctalSpecifier = BinarySpecifier | OctalSpecifier,
|
||||
/* @internal */
|
||||
NumericLiteralFlags = Scientific | Octal | HexSpecifier | BinaryOrOctalSpecifier | ContainsSeparator
|
||||
}
|
||||
|
||||
|
||||
@@ -156,7 +156,7 @@ namespace ts.codefix {
|
||||
isIdentifier(arg) ? arg.text :
|
||||
isPropertyAccessExpression(arg) ? arg.name.text : undefined);
|
||||
const contextualType = checker.getContextualType(call);
|
||||
const returnType = inJs ? undefined : contextualType && checker.typeToTypeNode(contextualType, contextNode, /*flags*/ undefined, tracker) || createKeywordTypeNode(SyntaxKind.AnyKeyword);
|
||||
const returnType = (inJs || !contextualType) ? undefined : checker.typeToTypeNode(contextualType, contextNode, /*flags*/ undefined, tracker);
|
||||
return createMethod(
|
||||
/*decorators*/ undefined,
|
||||
/*modifiers*/ makeStatic ? [createToken(SyntaxKind.StaticKeyword)] : undefined,
|
||||
|
||||
Reference in New Issue
Block a user