Skip to content

Do not report excess property errors on spread #19775

Closed
@mhegazy

Description

@mhegazy

The result of a spread operator should not contribute to the excess property checks. only the properties listed in the object literal should be checked. i.e.:

declare var x: { a: number };

var y: { b: number } = { ...x, b: 0 };  // no errors on x, but should be OK
var z: { b: number } = { ...x, b: 0, c: 1 };  // c is excess

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