Skip to content

Commit b321d50

Browse files
committed
Sub-subclasses can access protected constructor
1 parent e3fb305 commit b321d50

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/compiler/checker.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13467,13 +13467,14 @@ namespace ts {
1346713467
const containingClass = getContainingClass(node);
1346813468
if (containingClass) {
1346913469
const containingType = getTypeOfNode(containingClass);
13470-
const baseTypes = getBaseTypes(<InterfaceType>containingType);
13471-
if (baseTypes.length) {
13470+
let baseTypes = getBaseTypes(containingType as InterfaceType);
13471+
while (baseTypes.length) {
1347213472
const baseType = baseTypes[0];
1347313473
if (modifiers & ModifierFlags.Protected &&
1347413474
baseType.symbol === declaration.parent.symbol) {
1347513475
return true;
1347613476
}
13477+
baseTypes = getBaseTypes(baseType as InterfaceType);
1347713478
}
1347813479
}
1347913480
if (modifiers & ModifierFlags.Private) {

0 commit comments

Comments
 (0)