Do not emit declarations file if we reported error about inaccessible This type

This commit is contained in:
Sheetal Nandi 2015-10-20 11:50:27 -07:00
parent d14934e4da
commit c26d2da572
2 changed files with 1 additions and 45 deletions

View file

@ -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)));
}

View file

@ -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<T> {
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<this>;
i: Foo<this | (() => 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;
}