mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-11-18 20:11:14 +00:00
Merge pull request #12675 from Microsoft/subsubclass-can-access-protected-constructor
Subsubclass can access protected constructor
This commit is contained in:
commit
f79fca7087
5 files changed
+155
-2
No files matched your search
@@ -13475,13 +13475,14 @@ namespace ts {
|
||||
const containingClass = getContainingClass(node);
|
||||
if (containingClass) {
|
||||
const containingType = getTypeOfNode(containingClass);
|
||||
const baseTypes = getBaseTypes(<InterfaceType>containingType);
|
||||
if (baseTypes.length) {
|
||||
let baseTypes = getBaseTypes(containingType as InterfaceType);
|
||||
while (baseTypes.length) {
|
||||
const baseType = baseTypes[0];
|
||||
if (modifiers & ModifierFlags.Protected &&
|
||||
baseType.symbol === declaration.parent.symbol) {
|
||||
return true;
|
||||
}
|
||||
baseTypes = getBaseTypes(baseType as InterfaceType);
|
||||
}
|
||||
}
|
||||
if (modifiers & ModifierFlags.Private) {
|
||||
|
||||
Reference in new issue
Block a user