Update assertion: symbol in union type may be a Function (#18483)

This commit is contained in:
Andy 2017-09-14 15:02:32 -07:00 committed by GitHub
parent e1ede37ec7
commit c522f379b2
2 changed files with 17 additions and 1 deletions

View File

@ -61,7 +61,8 @@ namespace ts.SymbolDisplay {
if (rootSymbolFlags & (SymbolFlags.PropertyOrAccessor | SymbolFlags.Variable)) {
return ScriptElementKind.memberVariableElement;
}
Debug.assert(!!(rootSymbolFlags & SymbolFlags.Method));
// May be a Function if this was from `typeof N` with `namespace N { function f();. }`.
Debug.assert(!!(rootSymbolFlags & (SymbolFlags.Method | SymbolFlags.Function)));
});
if (!unionPropertyKind) {
// If this was union of all methods,

View File

@ -0,0 +1,15 @@
// See GH#18461
/// <reference path='fourslash.ts' />
////declare const x: typeof A | typeof B;
////x./**/f;
////
////namespace A {
//// export function f() {}
////}
////namespace B {
//// export function f() {}
////}
verify.quickInfoAt("", "(method) f(): void");