Merge pull request #12675 from Microsoft/subsubclass-can-access-protected-constructor

Subsubclass can access protected constructor
This commit is contained in:
Nathan Shively-Sanders
2016-12-08 08:58:58 -08:00
committed by GitHub
5 changed files with 155 additions and 2 deletions

View File

@@ -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) {