mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 21:36:50 -05:00
Ignore @private/@protected on constructor functions (#35782)
* Ignore @private on constructor functions This was incorrect in the best of circumstances and caused a crash when the parent of the function had no symbol, because the accessibility check assumed it was operating on a constructor and that the parent was always the containing class. * Non-constructors are always accessible Previously, all function-like kinds were accessible, which includes constructors. This was wrong.
This commit is contained in:
committed by
GitHub
parent
9445657184
commit
2cc1340a7b
@@ -24865,8 +24865,8 @@ namespace ts {
|
||||
const declaration = signature.declaration;
|
||||
const modifiers = getSelectedModifierFlags(declaration, ModifierFlags.NonPublicAccessibilityModifier);
|
||||
|
||||
// Public constructor is accessible.
|
||||
if (!modifiers) {
|
||||
// (1) Public constructors and (2) constructor functions are always accessible.
|
||||
if (!modifiers || declaration.kind !== SyntaxKind.Constructor) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user