File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -5995,7 +5995,9 @@ namespace ts {
59955995 for (const memberType of types) {
59965996 for (const { escapedName } of getAugmentedPropertiesOfType(memberType)) {
59975997 if (!props.has(escapedName)) {
5998- props.set(escapedName, createUnionOrIntersectionProperty(unionType as UnionType, escapedName));
5998+ const prop = createUnionOrIntersectionProperty(unionType as UnionType, escapedName);
5999+ // May be undefined if the property is private
6000+ if (prop) props.set(escapedName, prop);
59996001 }
60006002 }
60016003 }
@@ -6177,7 +6179,7 @@ namespace ts {
61776179 t;
61786180 }
61796181
6180- function createUnionOrIntersectionProperty(containingType: UnionOrIntersectionType, name: __String): Symbol {
6182+ function createUnionOrIntersectionProperty(containingType: UnionOrIntersectionType, name: __String): Symbol | undefined {
61816183 let props: Symbol[];
61826184 const isUnion = containingType.flags & TypeFlags.Union;
61836185 const excludeModifiers = isUnion ? ModifierFlags.NonPublicAccessibilityModifier : 0;
Original file line number Diff line number Diff line change 22
33////interface I { x: number; }
44////interface Many<T> extends ReadonlyArray<T> { extra: number; }
5- ////const x: I | I[] | Many<string> = { /**/ };
5+ ////class C { private priv: number; }
6+ ////const x: I | I[] | Many<string> | C = { /**/ };
67
78// We specifically filter out any array-like types.
9+ // Private members will be excluded by `createUnionOrIntersectionProperty`.
810verify . completionsAt ( "" , [ "x" ] ) ;
You can’t perform that action at this time.
0 commit comments