diff --git a/src/compiler/declarationEmitter.ts b/src/compiler/declarationEmitter.ts index 8b4e1500a1..efd5183ca6 100644 --- a/src/compiler/declarationEmitter.ts +++ b/src/compiler/declarationEmitter.ts @@ -263,6 +263,7 @@ namespace ts { function reportInaccessibleThisError() { if (errorNameNode) { + reportedDeclarationError = true; diagnostics.push(createDiagnosticForNode(errorNameNode, Diagnostics.The_inferred_type_of_0_references_an_inaccessible_this_type_A_type_annotation_is_necessary, declarationNameToString(errorNameNode))); } diff --git a/tests/baselines/reference/declarationFiles.js b/tests/baselines/reference/declarationFiles.js index d7ed9bde8c..7ef41a630c 100644 --- a/tests/baselines/reference/declarationFiles.js +++ b/tests/baselines/reference/declarationFiles.js @@ -88,48 +88,3 @@ var C4 = (function () { }; return C4; })(); - - -//// [declarationFiles.d.ts] -declare class C1 { - x: this; - f(x: this): this; - constructor(x: this); -} -declare class C2 { - [x: string]: this; -} -interface Foo { - x: T; - y: this; -} -declare class C3 { - a: this[]; - b: [this, this]; - c: this | Date; - d: this & Date; - e: (((this))); - f: (x: this) => this; - g: new (x: this) => this; - h: Foo; - i: Foo this)>; - j: (x: any) => x is this; -} -declare class C4 { - x1: { - a: this; - }; - x2: this[]; - x3: { - a: this; - }[]; - x4: () => this; - f1(): { - a: this; - }; - f2(): this[]; - f3(): { - a: this; - }[]; - f4(): () => this; -}