Fix the union property kind if the property is union of exported variable of module

Fixes #929
This commit is contained in:
Sheetal Nandi 2014-11-06 19:18:20 -08:00
parent 8ab038f1a3
commit 127aa49e55
2 changed files with 15 additions and 2 deletions

View File

@ -2784,10 +2784,10 @@ module ts {
if (flags & SymbolFlags.Property) {
if (flags & SymbolFlags.UnionProperty) {
// If union property is result of union of non method (property/accessors), it is labeled as property
// If union property is result of union of non method (property/accessors/variables), it is labeled as property
var unionPropertyKind = forEach(typeInfoResolver.getRootSymbols(symbol), rootSymbol => {
var rootSymbolFlags = rootSymbol.getFlags();
if (rootSymbolFlags & (SymbolFlags.Property | SymbolFlags.GetAccessor | SymbolFlags.SetAccessor)) {
if (rootSymbolFlags & (SymbolFlags.PropertyOrAccessor | SymbolFlags.Variable)) {
return ScriptElementKind.memberVariableElement;
}
Debug.assert(!!(rootSymbolFlags & SymbolFlags.Method));

View File

@ -0,0 +1,13 @@
///<reference path="fourslash.ts" />
////module E {
//// export var n = 1;
////}
////module F {
//// export var n = 1;
////}
////var q: typeof E | typeof F;
////var j = q./*1*/
goTo.marker('1');
verify.completionListContains('n', "(property) n: number");