Skip to content

Enhance Object.assign static method signature - #12110

Closed
falsandtru (falsandtru) wants to merge 1 commit into
microsoft:masterfrom
falsandtru:lib.d.ts/Object.assign
Closed

falsandtru (falsandtru) wants to merge 1 commit into
microsoft:masterfrom
falsandtru:lib.d.ts/Object.assign

Conversation

@falsandtru

Copy link
Copy Markdown
Contributor

Fixes #12109

@dead-claudia

Claudia Meadows (dead-claudia) commented Dec 13, 2016 •

Copy link
Copy Markdown

There's a glitch: Object.assign mutates the target assignee directly. So it should really look something like this (which is actually correct mod a missing object | Function type constraint where object is implemented in this PR):

interface Object {
    assign<T>(target: T, ...sources: Partial<T>): T;
}

@mhegazy

Copy link
Copy Markdown
Contributor

Nathan Shively-Sanders (@sandersn) is working on a fix for this as tracked by #11100. I would rather wait for that change.

@microsoft 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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants