Skip to content

Commit fe80647

Browse files
author
Yui T
committed
Fix error reporting position
1 parent c2d8671 commit fe80647

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/compiler/binder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ module ts {
8989
forEach(symbol.declarations, (declaration) => {
9090
file.semanticErrors.push(createDiagnosticForNode(declaration.name, Diagnostics.Duplicate_identifier_0, getDisplayName(declaration)));
9191
});
92-
file.semanticErrors.push(createDiagnosticForNode(node, Diagnostics.Duplicate_identifier_0, getDisplayName(node)));
92+
file.semanticErrors.push(createDiagnosticForNode(node.name, Diagnostics.Duplicate_identifier_0, getDisplayName(node)));
9393

9494
symbol = createSymbol(0, name);
9595
}

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5727,7 +5727,7 @@ module ts {
57275727

57285728
if (duplicateFunctionDeclaration) {
57295729
forEach( declarations, declaration => {
5730-
error(declaration, Diagnostics.Duplicate_function_implementation);
5730+
error(declaration.name, Diagnostics.Duplicate_function_implementation);
57315731
});
57325732
}
57335733

0 commit comments

Comments
 (0)