Merge pull request #8576 from Microsoft/intersection_quick_info

Fix #7966: A non-anonymous type can still fail to have a symbol.
This commit is contained in:
Andy 2016-05-12 10:35:41 -07:00
commit d9657b4368
2 changed files with 9 additions and 1 deletions

View File

@ -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) {
addRange(displayParts, symbolToDisplayParts(typeChecker, type.symbol, enclosingDeclaration, /*meaning*/ undefined, SymbolFormatFlags.WriteTypeParametersOrArguments));
}
addSignatureDisplayParts(signature, allSignatures, TypeFormatFlags.WriteArrowStyleSignature);

View File

@ -0,0 +1,8 @@
////function f(): string & {(): any} {
//// return <any>{};
////}
////let x = f();
////x/**/();
goTo.marker();
verify.quickInfoIs("let x: () => any");