Skip to content

Spread of type that is union of object types rejected by type checker  #12534

Closed
@Jessidhia

Description

@Jessidhia

TypeScript Version: 2.2.0-dev.20161127

Code

interface X {}
const x: {} | X = {}
const y = { ...x }

Actual behavior:

Error with "Spread types may only be created from object types".

Probably related to #12520.

Metadata

Metadata

Assignees

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