Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

object type can not be iterated with for...in #14792

Copy link
Copy link
@fpoppinga

Description

@fpoppinga
Issue body actions

TypeScript Version: 2.2.1

Code

function f(param : object) {
    for (let key in param) {

    }
}

f({'a' : 2});

Expected behavior:
Code compiles, I expect object to be of "object type".
Actual behavior:
TypeScript Error error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already createdAn existing issue was already created

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.