Closed
Description
Didn't find an issue on this.
TypeScript Version: 2.2.2
Code
type A = {
a: string,
b: string
}
let a: A = {
a: '1', b: '2', c: 3,
...{ x: 1 } // no error
}
Expected behavior:
I would expect TS Error like in this case
type A = {
a: string,
b: string
}
let a: A = {
a: '1', b: '2', c: 3 // error: Object literal may only specify known properties, and 'c' does not exist in type 'A'
}
Actual behavior:
No error
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
RyanCavanaugh commentedon Apr 5, 2017
See #12745
wclr commentedon Apr 5, 2017
@RyanCavanaugh what spread has to do with unions?
RyanCavanaugh commentedon Apr 5, 2017
Oops, #13878