diff --git a/src/services/services.ts b/src/services/services.ts index 84e5e7fefa5..d56c2c29639 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -3903,7 +3903,8 @@ module ts { } // if this symbol is visible from its parent container, e.g. exported, then bail out - if (symbol.parent) { + // if symbol correspond to the union property - bail out + if (symbol.parent || (symbol.getFlags() & SymbolFlags.UnionProperty)) { return undefined; } diff --git a/tests/cases/fourslash/scopeOfUnionProperties.ts b/tests/cases/fourslash/scopeOfUnionProperties.ts new file mode 100644 index 00000000000..ec2fe3a9ac5 --- /dev/null +++ b/tests/cases/fourslash/scopeOfUnionProperties.ts @@ -0,0 +1,7 @@ +/// + +////function f(s: string | number) { +//// s.constr/*1*/uctor +////} +goTo.marker("1") +verify.occurrencesAtPositionCount(1);