From 91ea83c72a07dbb0471d2a8e5ba6537e82b0b319 Mon Sep 17 00:00:00 2001 From: AbubakerB Date: Sat, 13 Feb 2016 02:51:25 +0000 Subject: [PATCH] Addressed PR --- src/compiler/checker.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index d6b67c456ca..533fffda805 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -14075,12 +14075,12 @@ namespace ts { } function checkBaseTypeAccessibility(type: ObjectType, node: ExpressionWithTypeArguments) { - const typeClassDeclaration = getClassLikeDeclarationOfSymbol(type.symbol); - if (!isNodeWithinClass(node, typeClassDeclaration)) { - const signatures = getSignaturesOfType(type, SignatureKind.Construct); - if (signatures.length) { - const declaration = signatures[0].declaration; - if (declaration && declaration.flags & NodeFlags.Private) { + const signatures = getSignaturesOfType(type, SignatureKind.Construct); + if (signatures.length) { + const declaration = signatures[0].declaration; + if (declaration && declaration.flags & NodeFlags.Private) { + const typeClassDeclaration = getClassLikeDeclarationOfSymbol(type.symbol); + if (!isNodeWithinClass(node, typeClassDeclaration)) { error(node, Diagnostics.Cannot_extend_a_class_0_Class_constructor_is_marked_as_private, (node.expression).text); } }