Skip to content

Commit 2ce627c

Browse files
committed
Handle union properties completions on apparant types
1 parent f5a9fee commit 2ce627c

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7916,7 +7916,7 @@ module ts {
79167916
var symbols: Symbol[] = [];
79177917
var name = symbol.name;
79187918
forEach(getSymbolLinks(symbol).unionType.types, t => {
7919-
symbols.push(getPropertyOfType(t, name));
7919+
symbols.push(getPropertyOfType(getApparentType(t), name));
79207920
});
79217921
return symbols;
79227922
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
///<reference path="fourslash.ts" />
2+
3+
////interface One {
4+
//// commonProperty: number;
5+
//// commonFunction(): number;
6+
////}
7+
////
8+
////interface Two {
9+
//// commonProperty: string
10+
//// commonFunction(): number;
11+
////}
12+
////
13+
////var x : One | Two;
14+
////
15+
////x.commonProperty./**/
16+
17+
goTo.marker();
18+
verify.memberListContains("toString", "() => string", undefined, undefined, "method");
19+
verify.memberListCount(1);

0 commit comments

Comments
 (0)