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 {
5995
5995
for (const memberType of types) {
5996
5996
for (const { escapedName } of getAugmentedPropertiesOfType(memberType)) {
5997
5997
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);
5999
6001
}
6000
6002
}
6001
6003
}
@@ -6177,7 +6179,7 @@ namespace ts {
6177
6179
t;
6178
6180
}
6179
6181
6180
- function createUnionOrIntersectionProperty(containingType: UnionOrIntersectionType, name: __String): Symbol {
6182
+ function createUnionOrIntersectionProperty(containingType: UnionOrIntersectionType, name: __String): Symbol | undefined {
6181
6183
let props: Symbol[];
6182
6184
const isUnion = containingType.flags & TypeFlags.Union;
6183
6185
const excludeModifiers = isUnion ? ModifierFlags.NonPublicAccessibilityModifier : 0;
Original file line number Diff line number Diff line change 2
2
3
3
////interface I { x: number; }
4
4
////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 = { /**/ };
6
7
7
8
// We specifically filter out any array-like types.
9
+ // Private members will be excluded by `createUnionOrIntersectionProperty`.
8
10
verify . completionsAt ( "" , [ "x" ] ) ;
You can’t perform that action at this time.
0 commit comments