From bda1f59d7b04bee5ac585e63bbf3ffff3247cfe2 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Apr 2015 14:39:02 -0700 Subject: [PATCH] Include property in union type only if all underlying properties are public --- src/compiler/checker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index e9430a058f8..630d108c0e9 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -2945,7 +2945,7 @@ module ts { let type = getApparentType(current); if (type !== unknownType) { let prop = getPropertyOfType(type, name); - if (!prop) { + if (!prop || getDeclarationFlagsFromSymbol(prop) & (NodeFlags.Private | NodeFlags.Protected)) { return undefined; } if (!props) {