Handle union properties completions on apparant types

This commit is contained in:
Mohamed Hegazy 2014-10-10 17:07:13 -07:00
parent f5a9feee9f
commit 2ce627c6dd
2 changed files with 20 additions and 1 deletions

View File

@ -7916,7 +7916,7 @@ module ts {
var symbols: Symbol[] = [];
var name = symbol.name;
forEach(getSymbolLinks(symbol).unionType.types, t => {
symbols.push(getPropertyOfType(t, name));
symbols.push(getPropertyOfType(getApparentType(t), name));
});
return symbols;
}

View File

@ -0,0 +1,19 @@
///<reference path="fourslash.ts" />
////interface One {
//// commonProperty: number;
//// commonFunction(): number;
////}
////
////interface Two {
//// commonProperty: string
//// commonFunction(): number;
////}
////
////var x : One | Two;
////
////x.commonProperty./**/
goTo.marker();
verify.memberListContains("toString", "() => string", undefined, undefined, "method");
verify.memberListCount(1);