-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue
Milestone
Description
TypeScript Version: 2.2.0
$ node_modules/.bin/tsc --version
Version 2.2.0
Code
let obj: object = {}
for (const attr in obj) {
const val = obj[attr]
}
Expected behavior:
Compiles without errors.
Actual behavior:
some.ts(3,20): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.
This is a new feature, so I'm not sure if I'm using this properly, but the error message says that an object type
is allowed, so I expect this behavior to be a bug.
vojtechhabarta, paleo and GeorgeKagan
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue