-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
Breaking ChangeWould introduce errors in existing codeWould introduce errors in existing codeCommittedThe team has roadmapped this issueThe team has roadmapped this issueIn DiscussionNot yet reached consensusNot yet reached consensusSuggestionAn idea for TypeScriptAn idea for TypeScript
Description
In the following statement,
for (let subscription in this._subscriptions) {
// Do something with subscription
}
The variable subscription
is considered type any
. Although I'm compiling with noImplicitAny
as true, no error is given. Based on the for spec, it seems as if subscription
should implicitly be considered string
.
Because of this, it's possible to compile with typo functions that will cause errors at runtime.
Metadata
Metadata
Assignees
Labels
Breaking ChangeWould introduce errors in existing codeWould introduce errors in existing codeCommittedThe team has roadmapped this issueThe team has roadmapped this issueIn DiscussionNot yet reached consensusNot yet reached consensusSuggestionAn idea for TypeScriptAn idea for TypeScript