From afc9f45468238e086d2d2fc5a6986ff7c30b9841 Mon Sep 17 00:00:00 2001 From: Chris Bubernak Date: Sat, 24 Jan 2015 08:50:01 -0800 Subject: [PATCH] more changes based on CR feedback --- src/compiler/checker.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 1bcc4cbcf24..c3b3ae9ed23 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -1097,10 +1097,10 @@ module ts { // Get qualified name if the symbol is not a type parameter // and there is an enclosing declaration or we specifically - // asked for it - var typeParameter = (symbol.flags & SymbolFlags.TypeParameter); + // asked for it + var isTypeParameter = symbol.flags & SymbolFlags.TypeParameter; var typeFormatFlag = TypeFormatFlags.UseFullyQualifiedType & typeFlags; - if (!typeParameter && (enclosingDeclaration || typeFormatFlag)) { + if (!isTypeParameter && (enclosingDeclaration || typeFormatFlag)) { walkSymbol(symbol, meaning); return; } @@ -1123,6 +1123,7 @@ module ts { writeTypeReference(type, flags); } else if (type.flags & (TypeFlags.Class | TypeFlags.Interface | TypeFlags.Enum | TypeFlags.TypeParameter)) { + // The specified symbol flags need to be reinterpreted as type flags buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, SymbolFlags.Type, SymbolFormatFlags.None, flags); } else if (type.flags & TypeFlags.Tuple) { @@ -1204,6 +1205,7 @@ module ts { // If type is an anonymous type literal in a type alias declaration, use type alias name var typeAlias = getTypeAliasForTypeLiteral(type); if (typeAlias) { + // The specified symbol flags need to be reinterpreted as type flags buildSymbolDisplay(typeAlias, writer, enclosingDeclaration, SymbolFlags.Type, SymbolFormatFlags.None, flags); } else { @@ -1238,10 +1240,10 @@ module ts { } } - function writeTypeofSymbol(type: ObjectType, flags?: TypeFormatFlags) { + function writeTypeofSymbol(type: ObjectType, typeFormatFlags?: TypeFormatFlags) { writeKeyword(writer, SyntaxKind.TypeOfKeyword); writeSpace(writer); - buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, SymbolFlags.Value, SymbolFormatFlags.None, flags); + buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, SymbolFlags.Value, SymbolFormatFlags.None, typeFormatFlags); } function getIndexerParameterName(type: ObjectType, indexKind: IndexKind, fallbackName: string): string {