Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No compile error with Object.assign #6689

Closed
Strate opened this issue Jan 28, 2016 · 1 comment
Closed

No compile error with Object.assign #6689

Strate opened this issue Jan 28, 2016 · 1 comment
Labels
Duplicate An existing issue was already created

Comments

@Strate
Copy link

Strate commented Jan 28, 2016

interface Struct {
  a: boolean
  b: number
}
let v1: Struct = {a: true, b:1}
let v2: Struct = Object.assign({}, v1, {
  b: false
})

v2 variable now contains {a: true, b: false}, which is definetely not Struct type. But there is no compile-time error there. How come?

@ahejlsberg ahejlsberg added the Duplicate An existing issue was already created label Jan 28, 2016
@ahejlsberg
Copy link
Member

This is a duplicate of the issue raised in #6613. We currently don't have the ability to exactly express the exact semantics of Object.assign.

@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

2 participants