From 0dbd30308450cf9d240284eefb45441fe28afd59 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 30 Sep 2014 17:14:58 -0700 Subject: [PATCH] Fix the quick info on error types --- src/compiler/checker.ts | 2 +- .../reference/dontShowCompilerGeneratedMembers.errors.txt | 4 ++-- .../{fourslash_old => fourslash}/quickInfoOnErrorTypes1.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) rename tests/cases/{fourslash_old => fourslash}/quickInfoOnErrorTypes1.ts (58%) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 8ffaa01033d..8b82247885c 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -1288,7 +1288,7 @@ module ts { } function writeTypeParameters(typeParameters: TypeParameter[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags, typeStack?: Type[]) { - if (typeParameters) { + if (typeParameters && typeParameters.length) { writePunctuation(writer, SyntaxKind.LessThanToken); for (var i = 0; i < typeParameters.length; i++) { if (i > 0) { diff --git a/tests/baselines/reference/dontShowCompilerGeneratedMembers.errors.txt b/tests/baselines/reference/dontShowCompilerGeneratedMembers.errors.txt index 6e9247d5c45..be90535f14c 100644 --- a/tests/baselines/reference/dontShowCompilerGeneratedMembers.errors.txt +++ b/tests/baselines/reference/dontShowCompilerGeneratedMembers.errors.txt @@ -2,14 +2,14 @@ tests/cases/compiler/dontShowCompilerGeneratedMembers.ts(3,5): error TS1098: Typ tests/cases/compiler/dontShowCompilerGeneratedMembers.ts(3,6): error TS1005: '(' expected. tests/cases/compiler/dontShowCompilerGeneratedMembers.ts(3,6): error TS1139: Type parameter declaration expected. tests/cases/compiler/dontShowCompilerGeneratedMembers.ts(4,1): error TS1109: Expression expected. -tests/cases/compiler/dontShowCompilerGeneratedMembers.ts(1,5): error TS2322: Type 'number' is not assignable to type '{ <>(): any; x: number; }': +tests/cases/compiler/dontShowCompilerGeneratedMembers.ts(1,5): error TS2322: Type 'number' is not assignable to type '{ (): any; x: number; }': Property 'x' is missing in type 'Number'. ==== tests/cases/compiler/dontShowCompilerGeneratedMembers.ts (5 errors) ==== var f: { ~ -!!! error TS2322: Type 'number' is not assignable to type '{ <>(): any; x: number; }': +!!! error TS2322: Type 'number' is not assignable to type '{ (): any; x: number; }': !!! error TS2322: Property 'x' is missing in type 'Number'. x: number; <- diff --git a/tests/cases/fourslash_old/quickInfoOnErrorTypes1.ts b/tests/cases/fourslash/quickInfoOnErrorTypes1.ts similarity index 58% rename from tests/cases/fourslash_old/quickInfoOnErrorTypes1.ts rename to tests/cases/fourslash/quickInfoOnErrorTypes1.ts index 9c0b26cda63..097c9ff15d3 100644 --- a/tests/cases/fourslash_old/quickInfoOnErrorTypes1.ts +++ b/tests/cases/fourslash/quickInfoOnErrorTypes1.ts @@ -6,4 +6,4 @@ ////}; goTo.marker('A'); -verify.quickInfoIs('{ x: number; (): any; }', "", "f", "var"); +verify.quickInfoIs('(var) f: {\n (): any;\n x: number;\n}', "");