- Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
CommittedThe team has roadmapped this issueThe team has roadmapped this issueFixedA PR has been merged for this issueA PR has been merged for this issueSuggestionAn idea for TypeScriptAn idea for TypeScript
Milestone
Description
/cc @vladima @ahejlsberg @billti
Motivating Examples
var arr = [1, 2, 3];
This should be an error (k
is always a string
):
for(var k in arr) { if(k === 0) { ... } }
This should not be an error, even under no implicit any:
for(var k in arr) { if(arr[k] === 0) { ... } }
This should somehow? not be an error, even though it involves a coercion we would normally disallow
for(var k in arr) { if (k > 0) { ... } }
Metadata
Metadata
Assignees
Labels
CommittedThe team has roadmapped this issueThe team has roadmapped this issueFixedA PR has been merged for this issueA PR has been merged for this issueSuggestionAn idea for TypeScriptAn idea for TypeScript