mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-04 21:53:42 -06:00
Handle union properties completions on apparant types
This commit is contained in:
parent
f5a9feee9f
commit
2ce627c6dd
@ -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;
|
||||
}
|
||||
|
||||
19
tests/cases/fourslash/completionEntryForUnionProperty2.ts
Normal file
19
tests/cases/fourslash/completionEntryForUnionProperty2.ts
Normal 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);
|
||||
Loading…
x
Reference in New Issue
Block a user