From 66b299dc6ecdb3e54af946d0fc4a349cf0e9249d Mon Sep 17 00:00:00 2001 From: Collins Abitekaniza Date: Tue, 16 Oct 2018 05:17:14 +0300 Subject: [PATCH] refactor diagnostics --- src/compiler/checker.ts | 6 +++--- src/compiler/diagnosticMessages.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index a94f0c2cf9b..c9065c96be1 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -6288,9 +6288,9 @@ namespace ts { // If we have an existing early-bound member, combine its declarations so that we can // report an error at each declaration. const declarations = earlySymbol ? concatenate(earlySymbol.declarations, lateSymbol.declarations) : lateSymbol.declarations; - const name = (type).value || declarationNameToString(decl.name) - forEach(declarations, declaration => error(getNameOfDeclaration(declaration) || declaration, Diagnostics.Duplicate_declaration_0, name)); - error(decl.name || decl, Diagnostics.Duplicate_declaration_0, name); + const name = (type).value || declarationNameToString(decl.name); + forEach(declarations, declaration => error(getNameOfDeclaration(declaration) || declaration, Diagnostics.Duplicate_property_0, name)); + error(decl.name || decl, Diagnostics.Duplicate_property_0, name); lateSymbol = createSymbol(SymbolFlags.None, memberName, CheckFlags.Late); } lateSymbol.nameType = type; diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 65a9e4bafb2..92ae359e1d2 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2425,7 +2425,7 @@ "category": "Error", "code": 2717 }, - "Duplicate declaration '{0}'.": { + "Duplicate property '{0}'.": { "category": "Error", "code": 2718 },