Skip to content
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
2 changes: 1 addition & 1 deletion src/services/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4349,7 +4349,7 @@ namespace ts {
displayParts.push(keywordPart(SyntaxKind.NewKeyword));
displayParts.push(spacePart());
}
if (!(type.flags & TypeFlags.Anonymous)) {
if (!(type.flags & TypeFlags.Anonymous) && type.symbol) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not just if (type.symbol)?

Copy link
Author

@ghost ghost May 12, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we allow anything with .symbol, anonymous function tooltips will look like var lambdaFoo: (Anonymous function)(a: number, b: number) => number instead of var lambdaFoo: (a: number, b: number) => number.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i see.

addRange(displayParts, symbolToDisplayParts(typeChecker, type.symbol, enclosingDeclaration, /*meaning*/ undefined, SymbolFormatFlags.WriteTypeParametersOrArguments));
}
addSignatureDisplayParts(signature, allSignatures, TypeFormatFlags.WriteArrowStyleSignature);
Expand Down
8 changes: 8 additions & 0 deletions tests/cases/fourslash/getQuickInfoForIntersectionTypes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
////function f(): string & {(): any} {
//// return <any>{};
////}
////let x = f();
////x/**/();

goTo.marker();
verify.quickInfoIs("let x: () => any");