mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-14 19:16:17 -06:00
Update assertion: symbol in union type may be a Function (#18483)
This commit is contained in:
parent
e1ede37ec7
commit
c522f379b2
@ -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,
|
||||
|
||||
15
tests/cases/fourslash/quickInfoUnionOfNamespaces.ts
Normal file
15
tests/cases/fourslash/quickInfoUnionOfNamespaces.ts
Normal 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");
|
||||
Loading…
x
Reference in New Issue
Block a user