Error on all uses of this that are implicitly any

Previously it was only an error inside an function.
This commit is contained in:
Nathan Shively-Sanders
2016-03-30 13:31:10 -07:00
parent f64110aa0f
commit 0113ad5250
4 changed files with 9 additions and 6 deletions

View File

@@ -8110,7 +8110,7 @@ namespace ts {
}
}
if (compilerOptions.noImplicitThis && isFunctionLike(container)) {
if (compilerOptions.noImplicitThis) {
// With noImplicitThis, functions may not reference 'this' if it has type 'any'
error(node, Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation);
}