We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 31d8cbe commit dac00d9Copy full SHA for dac00d9
src/compiler/checker.ts
@@ -15473,7 +15473,7 @@ namespace ts {
15473
// With noImplicitThis, functions may not reference 'this' if it has type 'any'
15474
error(
15475
node,
15476
- capturedByArrowFunction ?
+ capturedByArrowFunction && container.kind === SyntaxKind.SourceFile ?
15477
Diagnostics.The_containing_arrow_function_captures_the_global_value_of_this_which_implicitly_has_type_any :
15478
Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation);
15479
}
0 commit comments