From b321d50170ccd84a2bdd68ac301b370b74f9bcfb Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Mon, 5 Dec 2016 12:29:03 -0800 Subject: [PATCH] Sub-subclasses can access protected constructor --- src/compiler/checker.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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) {