From 777a25293e6b4ae0ecec94cae58b60a347f1911a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B8=D1=85=D0=B0=D0=B9=D0=BB=D0=BE=D0=B2=20=D0=90?= =?UTF-8?q?=D0=BD=D1=82=D0=BE=D0=BD?= Date: Thu, 15 Nov 2018 21:29:38 +0500 Subject: [PATCH] Object.assign return assigned type instead merged --- src/lib/es2015.core.d.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/lib/es2015.core.d.ts b/src/lib/es2015.core.d.ts index cfb300c784d74..1db580accbe30 100644 --- a/src/lib/es2015.core.d.ts +++ b/src/lib/es2015.core.d.ts @@ -256,6 +256,11 @@ interface NumberConstructor { parseInt(string: string, radix?: number): number; } +/** + * Assign properties from U to T. + */ +type Assign = Pick> & U + interface ObjectConstructor { /** * Copy the values of all of the enumerable own properties from one or more source objects to a @@ -263,7 +268,7 @@ interface ObjectConstructor { * @param target The target object to copy to. * @param source The source object from which to copy properties. */ - assign(target: T, source: U): T & U; + assign(target: T, source: U): Assign; /** * Copy the values of all of the enumerable own properties from one or more source objects to a @@ -272,7 +277,7 @@ interface ObjectConstructor { * @param source1 The first source object from which to copy properties. * @param source2 The second source object from which to copy properties. */ - assign(target: T, source1: U, source2: V): T & U & V; + assign(target: T, source1: U, source2: V): Assign, V>; /** * Copy the values of all of the enumerable own properties from one or more source objects to a @@ -282,7 +287,7 @@ interface ObjectConstructor { * @param source2 The second source object from which to copy properties. * @param source3 The third source object from which to copy properties. */ - assign(target: T, source1: U, source2: V, source3: W): T & U & V & W; + assign(target: T, source1: U, source2: V, source3: W): Assign, V>, W>; /** * Copy the values of all of the enumerable own properties from one or more source objects to a