diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 903c8cfda1c..96eefb68135 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -13467,13 +13467,14 @@ namespace ts { const containingClass = getContainingClass(node); if (containingClass) { const containingType = getTypeOfNode(containingClass); - const baseTypes = getBaseTypes(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) {