Skip to content

Commit dac00d9

Browse files
Do it correctly.
1 parent 31d8cbe commit dac00d9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/compiler/checker.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -15473,7 +15473,7 @@ namespace ts {
1547315473
// With noImplicitThis, functions may not reference 'this' if it has type 'any'
1547415474
error(
1547515475
node,
15476-
capturedByArrowFunction ?
15476+
capturedByArrowFunction && container.kind === SyntaxKind.SourceFile ?
1547715477
Diagnostics.The_containing_arrow_function_captures_the_global_value_of_this_which_implicitly_has_type_any :
1547815478
Diagnostics.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation);
1547915479
}

0 commit comments

Comments
 (0)