Skip to content

Commit fdafbd6

Browse files
committed
Report identical modifiers needed error when checking the file instead of reporting it as part of another file's type check
1 parent a27b29f commit fdafbd6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/compiler/checker.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25110,6 +25110,11 @@ namespace ts {
2511025110
checkParameterInitializer(node);
2511125111
}
2511225112
}
25113+
if (symbol.declarations.length > 1) {
25114+
if (some(symbol.declarations, d => d !== node && !areDeclarationFlagsIdentical(d, node))) {
25115+
error(node.name, Diagnostics.All_declarations_of_0_must_have_identical_modifiers, declarationNameToString(node.name));
25116+
}
25117+
}
2511325118
}
2511425119
else {
2511525120
// Node is a secondary declaration, check that type is identical to primary declaration and check that
@@ -25125,7 +25130,6 @@ namespace ts {
2512525130
checkTypeAssignableToAndOptionallyElaborate(checkExpressionCached(node.initializer), declarationType, node, node.initializer, /*headMessage*/ undefined);
2512625131
}
2512725132
if (!areDeclarationFlagsIdentical(node, symbol.valueDeclaration)) {
25128-
error(getNameOfDeclaration(symbol.valueDeclaration), Diagnostics.All_declarations_of_0_must_have_identical_modifiers, declarationNameToString(node.name));
2512925133
error(node.name, Diagnostics.All_declarations_of_0_must_have_identical_modifiers, declarationNameToString(node.name));
2513025134
}
2513125135
}

0 commit comments

Comments
 (0)