Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
1 commit merged into from
Sep 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/services/symbolDisplay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
15 changes: 15 additions & 0 deletions tests/cases/fourslash/quickInfoUnionOfNamespaces.ts
Original file line number Diff line number Diff line change
@@ -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");