Skip to content

object type does not work with in operator #14269

@EliSnow

Description

@EliSnow

TypeScript Version: 2.2.1

Code

const b = "foo" in <object> {};

Expected behavior:
The in operator works

Actual behavior:
A compile error is provided:
The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions