10000 Do not emit declarations file if we reported error about inaccessible… · imskojs/TypeScript@16becda · GitHub
[go: up one dir, main page]

Skip to content

Commit 16becda

Browse files
committed
Do not emit declarations file if we reported error about inaccessible This type
1 parent 0dc1a27 commit 16becda

File tree

2 files changed

+1
-45
lines changed

2 files changed

+1
-45
lines changed

src/compiler/declarationEmitter.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ namespace ts {
263263

264264
function reportInaccessibleThisError() {
265265
if (errorNameNode) {
266+
reportedDeclarationError = true;
266267
diagnostics.push(createDiagnosticForNode(errorNameNode, Diagnostics.The_inferred_type_of_0_references_an_inaccessible_this_type_A_type_annotation_is_necessary,
267268
declarationNameToString(errorNameNode)));
268269
}

tests/baselines/reference/declarationFiles.js

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -88,48 +88,3 @@ var C4 = (function () {
8888
};
8989
return C4;
9090
})();
91-
92-
93-
//// [declarationFiles.d.ts]
94-
declare class C1 {
95-
x: this;
96-
f(x: this): this;
97-
constructor(x: this);
98-
}
99-
declare class C2 {
100-
[x: string]: this;
101-
}
102-
interface Foo<T> {
103-
x: T;
104-
y: this;
105-
}
106-
declare class C3 {
107-
a: this[];
108-
b: [this, this];
109-
c: this | Date;
110-
d: this & Date;
111-
e: (((this)));
112-
f: (x: this) => this;
113-
g: new (x: this) => this;
114-
h: Foo<this>;
115-
i: Foo<this | (() => this)>;
116-
j: (x: any) => x is this;
117-
}
118-
declare class C4 {
119-
x1: {
120-
a: this;
121-
};
122-
x2: this[];
123-
x3: {
124-
a: this;
125-
}[];
126-
x4: () => this;
127-
f1(): {
128-
a: this;
129-
};
130-
f2(): this[];
131-
f3(): {
132-
a: this;
133-
}[];
134-
f4(): () => this;
135-
}

0 commit comments

Comments
 (0)
0