From 8b640becf353d9f1469fe6d8411c68ca60f8a9b3 Mon Sep 17 00:00:00 2001 From: graphemecluster Date: Fri, 26 Aug 2022 01:17:56 +0800 Subject: [PATCH 1/2] lib Types and Documentations Fix --- src/harness/fourslashInterfaceImpl.ts | 1 + src/lib/es2015.core.d.ts | 21 +- src/lib/es2017.object.d.ts | 2 +- src/lib/es2019.object.d.ts | 2 +- src/lib/es2022.object.d.ts | 2 +- src/lib/es5.d.ts | 43 ++- .../checkExportsObjectAssignProperty.types | 40 +-- ...ExportsObjectAssignPrototypeProperty.types | 20 +- ...aintOfJavascriptClassExpression.errors.txt | 2 +- .../reference/checkObjectDefineProperty.types | 24 +- .../checkOtherObjectAssignProperty.types | 24 +- .../conditionalTypeDoesntSpinForever.symbols | 32 +- .../conditionalTypeDoesntSpinForever.types | 58 ++-- ...ionEmitObjectAssignedDefaultExport.symbols | 4 +- ...ationEmitObjectAssignedDefaultExport.types | 6 +- ...iveInternalTypesProduceUniqueTypeParams.js | 26 +- ...ternalTypesProduceUniqueTypeParams.symbols | 8 +- ...InternalTypesProduceUniqueTypeParams.types | 30 +- ...tructuringParameterDeclaration4.errors.txt | 2 +- .../reference/destructuringTuple.errors.txt | 4 +- .../duplicateNumericIndexers.errors.txt | 4 +- ...ignmentDefineProperrtyPotentialMerge.types | 8 +- .../reference/es2018ObjectAssign.symbols | 4 +- .../reference/es2018ObjectAssign.types | 8 +- .../esNextWeakRefs_IterableWeakMap.types | 8 +- .../excessPropertyCheckWithEmptyObject.types | 4 +- .../reference/externModule.errors.txt | 8 +- .../reference/getterSetterNonAccessor.types | 4 +- .../reference/importAliasModuleExports.types | 4 +- .../intersectionsAndEmptyObjects.symbols | 4 +- .../intersectionsAndEmptyObjects.types | 6 +- .../reference/invalidTypeOfTarget.errors.txt | 2 +- ...efinePropertyPrototypeNonConstructor.types | 4 +- .../jsCheckObjectDefineThisNoCrash.types | 8 +- ...DeclarationsExportDefinePropertyEmit.types | 52 +-- .../jsDeclarationsGetterSetter.types | 12 +- .../jsExpandoObjectDefineProperty.types | 4 +- .../reference/jsFileESModuleWithEnumTag.types | 4 +- ...teBoundAssignmentDeclarationSupport3.types | 8 +- ...teBoundAssignmentDeclarationSupport6.types | 8 +- ...ithAsClauseAndLateBoundProperty.errors.txt | 2 +- ...wExceptionVariableInCatchClause.errors.txt | 2 +- .../narrowFromAnyWithInstanceof.errors.txt | 4 +- .../narrowFromAnyWithTypePredicate.errors.txt | 4 +- .../reference/objectFromEntries.types | 36 +-- .../reference/objectLitGetterSetter.types | 4 +- .../objectMethodNullability.errors.txt | 135 ++++++++ .../reference/objectMethodNullability.js | 95 ++++++ .../reference/objectMethodNullability.symbols | 225 +++++++++++++ .../reference/objectMethodNullability.types | 297 ++++++++++++++++++ ...erAccessAfterPostfixExpression1.errors.txt | 2 +- ...gularExpressionDivideAmbiguity1.errors.txt | 2 +- ...gularExpressionDivideAmbiguity2.errors.txt | 2 +- .../reference/parserS7.2_A1.5_T2.errors.txt | 4 +- .../reference/parserS7.3_A1.1_T2.errors.txt | 2 +- .../reference/parserS7.6_A4.2_T1.errors.txt | 20 +- .../reference/parserUnicode1.errors.txt | 4 +- .../parserUsingConstructorAsIdentifier.types | 4 +- .../reference/promisePermutations.errors.txt | 2 +- .../reference/promisePermutations2.errors.txt | 2 +- .../reference/promisePermutations3.errors.txt | 4 +- .../reference/redefineArray.errors.txt | 2 +- .../reference/scannerS7.2_A1.5_T2.errors.txt | 4 +- .../reference/scannerS7.3_A1.1_T2.errors.txt | 2 +- .../reference/scannerS7.6_A4.2_T1.errors.txt | 20 +- ...eStringsWithOverloadResolution1.errors.txt | 2 +- ...ingsWithOverloadResolution1_ES6.errors.txt | 2 +- ...ingsWithOverloadResolution3_ES6.errors.txt | 2 +- .../unionAndIntersectionInference1.symbols | 4 +- .../unionAndIntersectionInference1.types | 14 +- .../cases/compiler/objectMethodNullability.ts | 51 +++ 71 files changed, 1153 insertions(+), 317 deletions(-) create mode 100644 tests/baselines/reference/objectMethodNullability.errors.txt create mode 100644 tests/baselines/reference/objectMethodNullability.js create mode 100644 tests/baselines/reference/objectMethodNullability.symbols create mode 100644 tests/baselines/reference/objectMethodNullability.types create mode 100644 tests/cases/compiler/objectMethodNullability.ts diff --git a/src/harness/fourslashInterfaceImpl.ts b/src/harness/fourslashInterfaceImpl.ts index 93508a079ab5a..a2bec5821f6d6 100644 --- a/src/harness/fourslashInterfaceImpl.ts +++ b/src/harness/fourslashInterfaceImpl.ts @@ -1172,6 +1172,7 @@ namespace FourSlashInterface { typeEntry("Partial"), typeEntry("Required"), typeEntry("Readonly"), + typeEntry("Writable"), typeEntry("Pick"), typeEntry("Record"), typeEntry("Exclude"), diff --git a/src/lib/es2015.core.d.ts b/src/lib/es2015.core.d.ts index b42880c8ece82..1af43b82874a9 100644 --- a/src/lib/es2015.core.d.ts +++ b/src/lib/es2015.core.d.ts @@ -257,13 +257,20 @@ interface NumberConstructor { } interface ObjectConstructor { + /** + * Copy the values of all of the enumerable own properties from one or more source objects to a + * target object. Returns the target object. + * @param target The target object to copy to. + */ + assign(target: T): T; + /** * Copy the values of all of the enumerable own properties from one or more source objects to a * target object. Returns the target object. * @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): T & Writable; /** * Copy the values of all of the enumerable own properties from one or more source objects to a @@ -272,7 +279,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): T & Writable & Writable; /** * Copy the values of all of the enumerable own properties from one or more source objects to a @@ -282,21 +289,21 @@ 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): T & Writable & Writable & Writable; /** * Copy the values of all of the enumerable own properties from one or more source objects to a * target object. Returns the target object. * @param target The target object to copy to. - * @param sources One or more source objects from which to copy properties + * @param sources One or more source objects from which to copy properties. */ - assign(target: object, ...sources: any[]): any; + assign(target: {}, ...sources: any[]): any; /** * Returns an array of all symbol properties found directly on object o. * @param o Object to retrieve the symbols from. */ - getOwnPropertySymbols(o: any): symbol[]; + getOwnPropertySymbols(o: {}): symbol[]; /** * Returns the names of the enumerable string properties and methods of an object. @@ -316,7 +323,7 @@ interface ObjectConstructor { * @param o The object to change its prototype. * @param proto The value of the new prototype or null. */ - setPrototypeOf(o: any, proto: object | null): any; + setPrototypeOf(o: {}, proto: object | null): any; } interface ReadonlyArray { diff --git a/src/lib/es2017.object.d.ts b/src/lib/es2017.object.d.ts index b3ace85bef182..3e5dcc95629fe 100644 --- a/src/lib/es2017.object.d.ts +++ b/src/lib/es2017.object.d.ts @@ -27,5 +27,5 @@ interface ObjectConstructor { * Returns an object containing all own property descriptors of an object * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. */ - getOwnPropertyDescriptors(o: T): {[P in keyof T]: TypedPropertyDescriptor} & { [x: string]: PropertyDescriptor }; + getOwnPropertyDescriptors(o: T): { [P in keyof T]: TypedPropertyDescriptor } & PropertyDescriptorMap; } diff --git a/src/lib/es2019.object.d.ts b/src/lib/es2019.object.d.ts index e3518b7b9d689..7efcb4b861f13 100644 --- a/src/lib/es2019.object.d.ts +++ b/src/lib/es2019.object.d.ts @@ -5,7 +5,7 @@ interface ObjectConstructor { * Returns an object created by key-value entries for properties and methods * @param entries An iterable object that contains key-value entries for properties and methods. */ - fromEntries(entries: Iterable): { [k: string]: T }; + fromEntries(entries: Iterable): { [k: PropertyKey]: T }; /** * Returns an object created by key-value entries for properties and methods diff --git a/src/lib/es2022.object.d.ts b/src/lib/es2022.object.d.ts index 7325ef3c343e2..0a07706ba941c 100644 --- a/src/lib/es2022.object.d.ts +++ b/src/lib/es2022.object.d.ts @@ -4,5 +4,5 @@ interface ObjectConstructor { * @param o An object. * @param v A property name. */ - hasOwn(o: object, v: PropertyKey): boolean; + hasOwn(o: {}, v: PropertyKey): boolean; } diff --git a/src/lib/es5.d.ts b/src/lib/es5.d.ts index f4b499cd81691..d30d0c795c3f8 100644 --- a/src/lib/es5.d.ts +++ b/src/lib/es5.d.ts @@ -143,7 +143,7 @@ interface ObjectConstructor { * Returns the prototype of an object. * @param o The object that references the prototype. */ - getPrototypeOf(o: any): any; + getPrototypeOf(o: {}): any; /** * Gets the own property descriptor of the specified object. @@ -151,14 +151,14 @@ interface ObjectConstructor { * @param o Object that contains the property. * @param p Name of the property. */ - getOwnPropertyDescriptor(o: any, p: PropertyKey): PropertyDescriptor | undefined; + getOwnPropertyDescriptor(o: {}, p: PropertyKey): PropertyDescriptor | undefined; /** * Returns the names of the own properties of an object. The own properties of an object are those that are defined directly * on that object, and are not inherited from the object's prototype. The properties of an object include both fields (objects) and functions. * @param o Object that contains the own properties. */ - getOwnPropertyNames(o: any): string[]; + getOwnPropertyNames(o: {}): string[]; /** * Creates an object that has the specified prototype or that has null prototype. @@ -179,14 +179,14 @@ interface ObjectConstructor { * @param p The property name. * @param attributes Descriptor for the property. It can be for a data property or an accessor property. */ - defineProperty(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType): T; + defineProperty(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType): T; /** * Adds one or more properties to an object, and/or modifies attributes of existing properties. * @param o Object on which to add or modify the properties. This can be a native JavaScript object or a DOM object. * @param properties JavaScript object that contains one or more descriptor objects. Each descriptor object describes a data property or an accessor property. */ - defineProperties(o: T, properties: PropertyDescriptorMap & ThisType): T; + defineProperties(o: T, properties: PropertyDescriptorMap & ThisType): T; /** * Prevents the modification of attributes of existing properties, and prevents the addition of new properties. @@ -204,7 +204,7 @@ interface ObjectConstructor { * Prevents the modification of existing property attributes and values, and prevents the addition of new properties. * @param o Object on which to lock the attributes. */ - freeze(o: T): Readonly; + freeze(o: T): Readonly; /** * Prevents the modification of existing property attributes and values, and prevents the addition of new properties. @@ -222,19 +222,37 @@ interface ObjectConstructor { * Returns true if existing property attributes cannot be modified in an object and new properties cannot be added to the object. * @param o Object to test. */ - isSealed(o: any): boolean; + isSealed(o: object): boolean; + + /** + * Returns true if existing property attributes cannot be modified in an object and new properties cannot be added to the object. + * @param o Object to test. + */ + isSealed(o: any): true; + + /** + * Returns true if existing property attributes and values cannot be modified in an object, and new properties cannot be added to the object. + * @param o Object to test. + */ + isFrozen(o: object): boolean; /** * Returns true if existing property attributes and values cannot be modified in an object, and new properties cannot be added to the object. * @param o Object to test. */ - isFrozen(o: any): boolean; + isFrozen(o: any): true; /** * Returns a value that indicates whether new properties can be added to an object. * @param o Object to test. */ - isExtensible(o: any): boolean; + isExtensible(o: object): boolean; + + /** + * Returns a value that indicates whether new properties can be added to an object. + * @param o Object to test. + */ + isExtensible(o: any): false; /** * Returns the names of the enumerable string properties and methods of an object. @@ -1552,6 +1570,13 @@ type Readonly = { readonly [P in keyof T]: T[P]; }; +/** + * Make all properties in T writable + */ +type Writable = { + -readonly [P in keyof T]: T[P]; +}; + /** * From T, pick a set of properties whose keys are in the union K */ diff --git a/tests/baselines/reference/checkExportsObjectAssignProperty.types b/tests/baselines/reference/checkExportsObjectAssignProperty.types index 60fcd84477a12..77277f90ce369 100644 --- a/tests/baselines/reference/checkExportsObjectAssignProperty.types +++ b/tests/baselines/reference/checkExportsObjectAssignProperty.types @@ -176,9 +176,9 @@ m2.setonlyAccessor = 0; === tests/cases/conformance/jsdoc/mod1.js === Object.defineProperty(exports, "thing", { value: 42, writable: true }); >Object.defineProperty(exports, "thing", { value: 42, writable: true }) : typeof import("tests/cases/conformance/jsdoc/mod1") ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >exports : typeof import("tests/cases/conformance/jsdoc/mod1") >"thing" : "thing" >{ value: 42, writable: true } : { value: number; writable: true; } @@ -189,9 +189,9 @@ Object.defineProperty(exports, "thing", { value: 42, writable: true }); Object.defineProperty(exports, "readonlyProp", { value: "Smith", writable: false }); >Object.defineProperty(exports, "readonlyProp", { value: "Smith", writable: false }) : typeof import("tests/cases/conformance/jsdoc/mod1") ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >exports : typeof import("tests/cases/conformance/jsdoc/mod1") >"readonlyProp" : "readonlyProp" >{ value: "Smith", writable: false } : { value: string; writable: false; } @@ -202,9 +202,9 @@ Object.defineProperty(exports, "readonlyProp", { value: "Smith", writable: false Object.defineProperty(exports, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } }); >Object.defineProperty(exports, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } }) : typeof import("tests/cases/conformance/jsdoc/mod1") ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >exports : typeof import("tests/cases/conformance/jsdoc/mod1") >"rwAccessors" : "rwAccessors" >{ get() { return 98122 }, set(_) { /*ignore*/ } } : { get(): number; set(_: any): void; } @@ -215,9 +215,9 @@ Object.defineProperty(exports, "rwAccessors", { get() { return 98122 }, set(_) { Object.defineProperty(exports, "readonlyAccessor", { get() { return 21.75 } }); >Object.defineProperty(exports, "readonlyAccessor", { get() { return 21.75 } }) : typeof import("tests/cases/conformance/jsdoc/mod1") ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >exports : typeof import("tests/cases/conformance/jsdoc/mod1") >"readonlyAccessor" : "readonlyAccessor" >{ get() { return 21.75 } } : { get(): number; } @@ -226,9 +226,9 @@ Object.defineProperty(exports, "readonlyAccessor", { get() { return 21.75 } }); Object.defineProperty(exports, "setonlyAccessor", { >Object.defineProperty(exports, "setonlyAccessor", { /** @param {string} str */ set(str) { this.rwAccessors = Number(str) }}) : typeof import("tests/cases/conformance/jsdoc/mod1") ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >exports : typeof import("tests/cases/conformance/jsdoc/mod1") >"setonlyAccessor" : "setonlyAccessor" >{ /** @param {string} str */ set(str) { this.rwAccessors = Number(str) }} : { set(str: string): void; } @@ -252,9 +252,9 @@ Object.defineProperty(exports, "setonlyAccessor", { === tests/cases/conformance/jsdoc/mod2.js === Object.defineProperty(module.exports, "thing", { value: "yes", writable: true }); >Object.defineProperty(module.exports, "thing", { value: "yes", writable: true }) : typeof module.exports ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >module.exports : typeof module.exports >module : { exports: typeof module.exports; } >exports : typeof module.exports @@ -267,9 +267,9 @@ Object.defineProperty(module.exports, "thing", { value: "yes", writable: true }) Object.defineProperty(module.exports, "readonlyProp", { value: "Smith", writable: false }); >Object.defineProperty(module.exports, "readonlyProp", { value: "Smith", writable: false }) : typeof module.exports ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >module.exports : typeof module.exports >module : { exports: typeof module.exports; } >exports : typeof module.exports @@ -282,9 +282,9 @@ Object.defineProperty(module.exports, "readonlyProp", { value: "Smith", writable Object.defineProperty(module.exports, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } }); >Object.defineProperty(module.exports, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } }) : typeof module.exports ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >module.exports : typeof module.exports >module : { exports: typeof module.exports; } >exports : typeof module.exports @@ -297,9 +297,9 @@ Object.defineProperty(module.exports, "rwAccessors", { get() { return 98122 }, s Object.defineProperty(module.exports, "readonlyAccessor", { get() { return 21.75 } }); >Object.defineProperty(module.exports, "readonlyAccessor", { get() { return 21.75 } }) : typeof module.exports ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >module.exports : typeof module.exports >module : { exports: typeof module.exports; } >exports : typeof module.exports @@ -310,9 +310,9 @@ Object.defineProperty(module.exports, "readonlyAccessor", { get() { return 21.75 Object.defineProperty(module.exports, "setonlyAccessor", { >Object.defineProperty(module.exports, "setonlyAccessor", { /** @param {string} str */ set(str) { this.rwAccessors = Number(str) }}) : typeof module.exports ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >module.exports : typeof module.exports >module : { exports: typeof module.exports; } >exports : typeof module.exports diff --git a/tests/baselines/reference/checkExportsObjectAssignPrototypeProperty.types b/tests/baselines/reference/checkExportsObjectAssignPrototypeProperty.types index 6ea6a5ff129b8..1a24db4e9ec46 100644 --- a/tests/baselines/reference/checkExportsObjectAssignPrototypeProperty.types +++ b/tests/baselines/reference/checkExportsObjectAssignPrototypeProperty.types @@ -129,9 +129,9 @@ Person.prototype.describe = function () { }; Object.defineProperty(Person.prototype, "thing", { value: 42, writable: true }); >Object.defineProperty(Person.prototype, "thing", { value: 42, writable: true }) : any ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Person.prototype : any >Person : typeof Person >prototype : any @@ -144,9 +144,9 @@ Object.defineProperty(Person.prototype, "thing", { value: 42, writable: true }); Object.defineProperty(Person.prototype, "readonlyProp", { value: "Smith", writable: false }); >Object.defineProperty(Person.prototype, "readonlyProp", { value: "Smith", writable: false }) : any ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Person.prototype : any >Person : typeof Person >prototype : any @@ -159,9 +159,9 @@ Object.defineProperty(Person.prototype, "readonlyProp", { value: "Smith", writab Object.defineProperty(Person.prototype, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } }); >Object.defineProperty(Person.prototype, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } }) : any ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Person.prototype : any >Person : typeof Person >prototype : any @@ -174,9 +174,9 @@ Object.defineProperty(Person.prototype, "rwAccessors", { get() { return 98122 }, Object.defineProperty(Person.prototype, "readonlyAccessor", { get() { return 21.75 } }); >Object.defineProperty(Person.prototype, "readonlyAccessor", { get() { return 21.75 } }) : any ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Person.prototype : any >Person : typeof Person >prototype : any @@ -187,9 +187,9 @@ Object.defineProperty(Person.prototype, "readonlyAccessor", { get() { return 21. Object.defineProperty(Person.prototype, "setonlyAccessor", { >Object.defineProperty(Person.prototype, "setonlyAccessor", { /** @param {string} str */ set(str) { this.rwAccessors = Number(str) }}) : any ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Person.prototype : any >Person : typeof Person >prototype : any diff --git a/tests/baselines/reference/checkIndexConstraintOfJavascriptClassExpression.errors.txt b/tests/baselines/reference/checkIndexConstraintOfJavascriptClassExpression.errors.txt index c2defbf869963..446285f1766ea 100644 --- a/tests/baselines/reference/checkIndexConstraintOfJavascriptClassExpression.errors.txt +++ b/tests/baselines/reference/checkIndexConstraintOfJavascriptClassExpression.errors.txt @@ -7,7 +7,7 @@ tests/cases/compiler/weird.js(9,17): error TS7006: Parameter 'error' implicitly someFunction(function(BaseClass) { ~~~~~~~~~~~~ !!! error TS2552: Cannot find name 'someFunction'. Did you mean 'Function'? -!!! related TS2728 /.ts/lib.es5.d.ts:318:13: 'Function' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:336:13: 'Function' is declared here. ~~~~~~~~~ !!! error TS7006: Parameter 'BaseClass' implicitly has an 'any' type. 'use strict'; diff --git a/tests/baselines/reference/checkObjectDefineProperty.types b/tests/baselines/reference/checkObjectDefineProperty.types index 05f8b200c51f8..a96c2e2209571 100644 --- a/tests/baselines/reference/checkObjectDefineProperty.types +++ b/tests/baselines/reference/checkObjectDefineProperty.types @@ -89,9 +89,9 @@ const x = {}; Object.defineProperty(x, "name", { value: "Charles", writable: true }); >Object.defineProperty(x, "name", { value: "Charles", writable: true }) : typeof x ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >x : typeof x >"name" : "name" >{ value: "Charles", writable: true } : { value: string; writable: true; } @@ -102,9 +102,9 @@ Object.defineProperty(x, "name", { value: "Charles", writable: true }); Object.defineProperty(x, "middleInit", { value: "H" }); >Object.defineProperty(x, "middleInit", { value: "H" }) : typeof x ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >x : typeof x >"middleInit" : "middleInit" >{ value: "H" } : { value: string; } @@ -113,9 +113,9 @@ Object.defineProperty(x, "middleInit", { value: "H" }); Object.defineProperty(x, "lastName", { value: "Smith", writable: false }); >Object.defineProperty(x, "lastName", { value: "Smith", writable: false }) : typeof x ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >x : typeof x >"lastName" : "lastName" >{ value: "Smith", writable: false } : { value: string; writable: false; } @@ -126,9 +126,9 @@ Object.defineProperty(x, "lastName", { value: "Smith", writable: false }); Object.defineProperty(x, "zip", { get() { return 98122 }, set(_) { /*ignore*/ } }); >Object.defineProperty(x, "zip", { get() { return 98122 }, set(_) { /*ignore*/ } }) : typeof x ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >x : typeof x >"zip" : "zip" >{ get() { return 98122 }, set(_) { /*ignore*/ } } : { get(): number; set(_: any): void; } @@ -139,9 +139,9 @@ Object.defineProperty(x, "zip", { get() { return 98122 }, set(_) { /*ignore*/ } Object.defineProperty(x, "houseNumber", { get() { return 21.75 } }); >Object.defineProperty(x, "houseNumber", { get() { return 21.75 } }) : typeof x ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >x : typeof x >"houseNumber" : "houseNumber" >{ get() { return 21.75 } } : { get(): number; } @@ -150,9 +150,9 @@ Object.defineProperty(x, "houseNumber", { get() { return 21.75 } }); Object.defineProperty(x, "zipStr", { >Object.defineProperty(x, "zipStr", { /** @param {string} str */ set(str) { this.zip = Number(str) }}) : typeof x ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >x : typeof x >"zipStr" : "zipStr" >{ /** @param {string} str */ set(str) { this.zip = Number(str) }} : { set(str: string): void; } diff --git a/tests/baselines/reference/checkOtherObjectAssignProperty.types b/tests/baselines/reference/checkOtherObjectAssignProperty.types index 180ea63989945..0ffa9620bc5fc 100644 --- a/tests/baselines/reference/checkOtherObjectAssignProperty.types +++ b/tests/baselines/reference/checkOtherObjectAssignProperty.types @@ -89,9 +89,9 @@ const obj = { value: 42, writable: true }; Object.defineProperty(exports, "thing", obj); >Object.defineProperty(exports, "thing", obj) : typeof import("tests/cases/conformance/jsdoc/mod1") ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >exports : typeof import("tests/cases/conformance/jsdoc/mod1") >"thing" : "thing" >obj : { value: number; writable: boolean; } @@ -106,9 +106,9 @@ let str = /** @type {string} */("other"); Object.defineProperty(exports, str, { value: 42, writable: true }); >Object.defineProperty(exports, str, { value: 42, writable: true }) : typeof import("tests/cases/conformance/jsdoc/mod1") ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >exports : typeof import("tests/cases/conformance/jsdoc/mod1") >str : string >{ value: 42, writable: true } : { value: number; writable: true; } @@ -123,9 +123,9 @@ const propName = "prop" Object.defineProperty(exports, propName, { value: 42, writable: true }); >Object.defineProperty(exports, propName, { value: 42, writable: true }) : typeof import("tests/cases/conformance/jsdoc/mod1") ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >exports : typeof import("tests/cases/conformance/jsdoc/mod1") >propName : "prop" >{ value: 42, writable: true } : { value: number; writable: true; } @@ -137,18 +137,18 @@ Object.defineProperty(exports, propName, { value: 42, writable: true }); Object.defineProperty(exports, "bad1", { }); >Object.defineProperty(exports, "bad1", { }) : typeof import("tests/cases/conformance/jsdoc/mod1") ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >exports : typeof import("tests/cases/conformance/jsdoc/mod1") >"bad1" : "bad1" >{ } : {} Object.defineProperty(exports, "bad2", { get() { return 12 }, value: "no" }); >Object.defineProperty(exports, "bad2", { get() { return 12 }, value: "no" }) : typeof import("tests/cases/conformance/jsdoc/mod1") ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >exports : typeof import("tests/cases/conformance/jsdoc/mod1") >"bad2" : "bad2" >{ get() { return 12 }, value: "no" } : { get(): number; value: string; } @@ -159,9 +159,9 @@ Object.defineProperty(exports, "bad2", { get() { return 12 }, value: "no" }); Object.defineProperty(exports, "bad3", { writable: true }); >Object.defineProperty(exports, "bad3", { writable: true }) : typeof import("tests/cases/conformance/jsdoc/mod1") ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >exports : typeof import("tests/cases/conformance/jsdoc/mod1") >"bad3" : "bad3" >{ writable: true } : { writable: true; } diff --git a/tests/baselines/reference/conditionalTypeDoesntSpinForever.symbols b/tests/baselines/reference/conditionalTypeDoesntSpinForever.symbols index b5dcb78015b3f..3e2f1b61b791a 100644 --- a/tests/baselines/reference/conditionalTypeDoesntSpinForever.symbols +++ b/tests/baselines/reference/conditionalTypeDoesntSpinForever.symbols @@ -77,9 +77,9 @@ export enum PubSubRecordIsStoredInRedisAsA { buildPubSubRecordType(Object.assign({}, soFar, {name: instance as TYPE}) as SO_FAR & {name: TYPE}) as BuildPubSubRecordType >buildPubSubRecordType : Symbol(buildPubSubRecordType, Decl(conditionalTypeDoesntSpinForever.ts, 108, 7)) ->Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >soFar : Symbol(soFar, Decl(conditionalTypeDoesntSpinForever.ts, 21, 45)) >name : Symbol(name, Decl(conditionalTypeDoesntSpinForever.ts, 24, 56)) >instance : Symbol(instance, Decl(conditionalTypeDoesntSpinForever.ts, 23, 19)) @@ -133,9 +133,9 @@ export enum PubSubRecordIsStoredInRedisAsA { buildPubSubRecordType(Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString})) as >buildPubSubRecordType : Symbol(buildPubSubRecordType, Decl(conditionalTypeDoesntSpinForever.ts, 108, 7)) ->Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >soFar : Symbol(soFar, Decl(conditionalTypeDoesntSpinForever.ts, 34, 44)) >storedAs : Symbol(storedAs, Decl(conditionalTypeDoesntSpinForever.ts, 37, 56)) >PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString : Symbol(PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString, Decl(conditionalTypeDoesntSpinForever.ts, 4, 28)) @@ -154,9 +154,9 @@ export enum PubSubRecordIsStoredInRedisAsA { buildPubSubRecordType(Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.redisHash})) as >buildPubSubRecordType : Symbol(buildPubSubRecordType, Decl(conditionalTypeDoesntSpinForever.ts, 108, 7)) ->Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >soFar : Symbol(soFar, Decl(conditionalTypeDoesntSpinForever.ts, 34, 44)) >storedAs : Symbol(storedAs, Decl(conditionalTypeDoesntSpinForever.ts, 40, 56)) >PubSubRecordIsStoredInRedisAsA.redisHash : Symbol(PubSubRecordIsStoredInRedisAsA.redisHash, Decl(conditionalTypeDoesntSpinForever.ts, 3, 44)) @@ -217,9 +217,9 @@ export enum PubSubRecordIsStoredInRedisAsA { buildPubSubRecordType(Object.assign({}, soFar, {identifier: instance as TYPE}) as SO_FAR & {identifier: TYPE}) as BuildPubSubRecordType >buildPubSubRecordType : Symbol(buildPubSubRecordType, Decl(conditionalTypeDoesntSpinForever.ts, 108, 7)) ->Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >soFar : Symbol(soFar, Decl(conditionalTypeDoesntSpinForever.ts, 51, 51)) >identifier : Symbol(identifier, Decl(conditionalTypeDoesntSpinForever.ts, 54, 56)) >instance : Symbol(instance, Decl(conditionalTypeDoesntSpinForever.ts, 53, 25)) @@ -271,9 +271,9 @@ export enum PubSubRecordIsStoredInRedisAsA { buildPubSubRecordType(Object.assign({}, soFar, {record: instance as TYPE}) as SO_FAR & {record: TYPE}) as BuildPubSubRecordType >buildPubSubRecordType : Symbol(buildPubSubRecordType, Decl(conditionalTypeDoesntSpinForever.ts, 108, 7)) ->Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >soFar : Symbol(soFar, Decl(conditionalTypeDoesntSpinForever.ts, 63, 47)) >record : Symbol(record, Decl(conditionalTypeDoesntSpinForever.ts, 66, 56)) >instance : Symbol(instance, Decl(conditionalTypeDoesntSpinForever.ts, 65, 21)) @@ -327,9 +327,9 @@ export enum PubSubRecordIsStoredInRedisAsA { buildPubSubRecordType(Object.assign({}, soFar, {maxMsToWaitBeforePublishing: instance})) as BuildPubSubRecordType, >buildPubSubRecordType : Symbol(buildPubSubRecordType, Decl(conditionalTypeDoesntSpinForever.ts, 108, 7)) ->Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >soFar : Symbol(soFar, Decl(conditionalTypeDoesntSpinForever.ts, 76, 68)) >maxMsToWaitBeforePublishing : Symbol(maxMsToWaitBeforePublishing, Decl(conditionalTypeDoesntSpinForever.ts, 79, 56)) >instance : Symbol(instance, Decl(conditionalTypeDoesntSpinForever.ts, 78, 36)) @@ -342,9 +342,9 @@ export enum PubSubRecordIsStoredInRedisAsA { buildPubSubRecordType(Object.assign({}, soFar, {maxMsToWaitBeforePublishing: 0})) as BuildPubSubRecordType, >buildPubSubRecordType : Symbol(buildPubSubRecordType, Decl(conditionalTypeDoesntSpinForever.ts, 108, 7)) ->Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >soFar : Symbol(soFar, Decl(conditionalTypeDoesntSpinForever.ts, 76, 68)) >maxMsToWaitBeforePublishing : Symbol(maxMsToWaitBeforePublishing, Decl(conditionalTypeDoesntSpinForever.ts, 81, 56)) >BuildPubSubRecordType : Symbol(BuildPubSubRecordType, Decl(conditionalTypeDoesntSpinForever.ts, 98, 4)) @@ -450,9 +450,9 @@ export enum PubSubRecordIsStoredInRedisAsA { >SO_FAR : Symbol(SO_FAR, Decl(conditionalTypeDoesntSpinForever.ts, 108, 33)) >soFar : Symbol(soFar, Decl(conditionalTypeDoesntSpinForever.ts, 108, 41)) >SO_FAR : Symbol(SO_FAR, Decl(conditionalTypeDoesntSpinForever.ts, 108, 33)) ->Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) {}, buildNameFieldConstructor(soFar), diff --git a/tests/baselines/reference/conditionalTypeDoesntSpinForever.types b/tests/baselines/reference/conditionalTypeDoesntSpinForever.types index c1eee6deff83f..09235dcd3f961 100644 --- a/tests/baselines/reference/conditionalTypeDoesntSpinForever.types +++ b/tests/baselines/reference/conditionalTypeDoesntSpinForever.types @@ -68,10 +68,10 @@ export enum PubSubRecordIsStoredInRedisAsA { >buildPubSubRecordType(Object.assign({}, soFar, {name: instance as TYPE}) as SO_FAR & {name: TYPE}) : BuildPubSubRecordType >buildPubSubRecordType : (soFar: SO_FAR) => BuildPubSubRecordType >Object.assign({}, soFar, {name: instance as TYPE}) as SO_FAR & {name: TYPE} : SO_FAR & { name: TYPE; } ->Object.assign({}, soFar, {name: instance as TYPE}) : SO_FAR & { name: TYPE; } ->Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>Object.assign({}, soFar, {name: instance as TYPE}) : Writable & Writable<{ name: TYPE; }> +>Object.assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } >Object : ObjectConstructor ->assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } >{} : {} >soFar : SO_FAR >{name: instance as TYPE} : { name: TYPE; } @@ -120,12 +120,12 @@ export enum PubSubRecordIsStoredInRedisAsA { buildPubSubRecordType(Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString})) as >buildPubSubRecordType(Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString})) as BuildPubSubRecordType : BuildPubSubRecordType ->buildPubSubRecordType(Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString})) : BuildPubSubRecordType +>buildPubSubRecordType(Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString})) : BuildPubSubRecordType & Writable<{ storedAs: PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString; }>> >buildPubSubRecordType : (soFar: SO_FAR) => BuildPubSubRecordType ->Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString}) : SO_FAR & { storedAs: PubSubRecordIsStoredInRedisAsA; } ->Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString}) : Writable & Writable<{ storedAs: PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString; }> +>Object.assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } >Object : ObjectConstructor ->assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } >{} : {} >soFar : SO_FAR >{storedAs: PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString} : { storedAs: PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString; } @@ -144,12 +144,12 @@ export enum PubSubRecordIsStoredInRedisAsA { buildPubSubRecordType(Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.redisHash})) as >buildPubSubRecordType(Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.redisHash})) as BuildPubSubRecordType : BuildPubSubRecordType ->buildPubSubRecordType(Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.redisHash})) : BuildPubSubRecordType +>buildPubSubRecordType(Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.redisHash})) : BuildPubSubRecordType & Writable<{ storedAs: PubSubRecordIsStoredInRedisAsA.redisHash; }>> >buildPubSubRecordType : (soFar: SO_FAR) => BuildPubSubRecordType ->Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.redisHash}) : SO_FAR & { storedAs: PubSubRecordIsStoredInRedisAsA; } ->Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.redisHash}) : Writable & Writable<{ storedAs: PubSubRecordIsStoredInRedisAsA.redisHash; }> +>Object.assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } >Object : ObjectConstructor ->assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } >{} : {} >soFar : SO_FAR >{storedAs: PubSubRecordIsStoredInRedisAsA.redisHash} : { storedAs: PubSubRecordIsStoredInRedisAsA.redisHash; } @@ -212,10 +212,10 @@ export enum PubSubRecordIsStoredInRedisAsA { >buildPubSubRecordType(Object.assign({}, soFar, {identifier: instance as TYPE}) as SO_FAR & {identifier: TYPE}) : BuildPubSubRecordType >buildPubSubRecordType : (soFar: SO_FAR) => BuildPubSubRecordType >Object.assign({}, soFar, {identifier: instance as TYPE}) as SO_FAR & {identifier: TYPE} : SO_FAR & { identifier: TYPE; } ->Object.assign({}, soFar, {identifier: instance as TYPE}) : SO_FAR & { identifier: TYPE; } ->Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>Object.assign({}, soFar, {identifier: instance as TYPE}) : Writable & Writable<{ identifier: TYPE; }> +>Object.assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } >Object : ObjectConstructor ->assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } >{} : {} >soFar : SO_FAR >{identifier: instance as TYPE} : { identifier: TYPE; } @@ -264,10 +264,10 @@ export enum PubSubRecordIsStoredInRedisAsA { >buildPubSubRecordType(Object.assign({}, soFar, {record: instance as TYPE}) as SO_FAR & {record: TYPE}) : BuildPubSubRecordType >buildPubSubRecordType : (soFar: SO_FAR) => BuildPubSubRecordType >Object.assign({}, soFar, {record: instance as TYPE}) as SO_FAR & {record: TYPE} : SO_FAR & { record: TYPE; } ->Object.assign({}, soFar, {record: instance as TYPE}) : SO_FAR & { record: TYPE; } ->Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>Object.assign({}, soFar, {record: instance as TYPE}) : Writable & Writable<{ record: TYPE; }> +>Object.assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } >Object : ObjectConstructor ->assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } >{} : {} >soFar : SO_FAR >{record: instance as TYPE} : { record: TYPE; } @@ -318,12 +318,12 @@ export enum PubSubRecordIsStoredInRedisAsA { buildPubSubRecordType(Object.assign({}, soFar, {maxMsToWaitBeforePublishing: instance})) as BuildPubSubRecordType, >buildPubSubRecordType(Object.assign({}, soFar, {maxMsToWaitBeforePublishing: instance})) as BuildPubSubRecordType : BuildPubSubRecordType ->buildPubSubRecordType(Object.assign({}, soFar, {maxMsToWaitBeforePublishing: instance})) : BuildPubSubRecordType +>buildPubSubRecordType(Object.assign({}, soFar, {maxMsToWaitBeforePublishing: instance})) : BuildPubSubRecordType & Writable<{ maxMsToWaitBeforePublishing: number; }>> >buildPubSubRecordType : (soFar: SO_FAR) => BuildPubSubRecordType ->Object.assign({}, soFar, {maxMsToWaitBeforePublishing: instance}) : SO_FAR & { maxMsToWaitBeforePublishing: number; } ->Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>Object.assign({}, soFar, {maxMsToWaitBeforePublishing: instance}) : Writable & Writable<{ maxMsToWaitBeforePublishing: number; }> +>Object.assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } >Object : ObjectConstructor ->assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } >{} : {} >soFar : SO_FAR >{maxMsToWaitBeforePublishing: instance} : { maxMsToWaitBeforePublishing: number; } @@ -337,16 +337,16 @@ export enum PubSubRecordIsStoredInRedisAsA { buildPubSubRecordType(Object.assign({}, soFar, {maxMsToWaitBeforePublishing: 0})) as BuildPubSubRecordType, >buildPubSubRecordType(Object.assign({}, soFar, {maxMsToWaitBeforePublishing: 0})) as BuildPubSubRecordType : BuildPubSubRecordType ->buildPubSubRecordType(Object.assign({}, soFar, {maxMsToWaitBeforePublishing: 0})) : BuildPubSubRecordType +>buildPubSubRecordType(Object.assign({}, soFar, {maxMsToWaitBeforePublishing: 0})) : BuildPubSubRecordType & Writable<{ maxMsToWaitBeforePublishing: 0; }>> >buildPubSubRecordType : (soFar: SO_FAR) => BuildPubSubRecordType ->Object.assign({}, soFar, {maxMsToWaitBeforePublishing: 0}) : SO_FAR & { maxMsToWaitBeforePublishing: number; } ->Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>Object.assign({}, soFar, {maxMsToWaitBeforePublishing: 0}) : Writable & Writable<{ maxMsToWaitBeforePublishing: 0; }> +>Object.assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } >Object : ObjectConstructor ->assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } >{} : {} >soFar : SO_FAR ->{maxMsToWaitBeforePublishing: 0} : { maxMsToWaitBeforePublishing: number; } ->maxMsToWaitBeforePublishing : number +>{maxMsToWaitBeforePublishing: 0} : { maxMsToWaitBeforePublishing: 0; } +>maxMsToWaitBeforePublishing : 0 >0 : 0 >maxMsToWaitBeforePublishing : 0 } @@ -441,9 +441,9 @@ export enum PubSubRecordIsStoredInRedisAsA { >soFar : SO_FAR >Object.assign( {}, buildNameFieldConstructor(soFar), buildIdentifierFieldConstructor(soFar), buildRecordFieldConstructor(soFar), buildStoredAsConstructor(soFar), buildMaxMsToWaitBeforePublishingFieldConstructor(soFar), buildType(soFar) ) as BuildPubSubRecordType : BuildPubSubRecordType >Object.assign( {}, buildNameFieldConstructor(soFar), buildIdentifierFieldConstructor(soFar), buildRecordFieldConstructor(soFar), buildStoredAsConstructor(soFar), buildMaxMsToWaitBeforePublishingFieldConstructor(soFar), buildType(soFar) ) : any ->Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>Object.assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } >Object : ObjectConstructor ->assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } {}, >{} : {} diff --git a/tests/baselines/reference/declarationEmitObjectAssignedDefaultExport.symbols b/tests/baselines/reference/declarationEmitObjectAssignedDefaultExport.symbols index 659edb5ddca3c..981f13e3820d6 100644 --- a/tests/baselines/reference/declarationEmitObjectAssignedDefaultExport.symbols +++ b/tests/baselines/reference/declarationEmitObjectAssignedDefaultExport.symbols @@ -113,9 +113,9 @@ export const C = styled.div``; >div : Symbol(StyledInterface.div, Decl(index.d.ts, 12, 34)) export default Object.assign(A, { ->Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >A : Symbol(A, Decl(index.ts, 2, 5)) B, diff --git a/tests/baselines/reference/declarationEmitObjectAssignedDefaultExport.types b/tests/baselines/reference/declarationEmitObjectAssignedDefaultExport.types index 9d05d21a2fdd6..acc7ad58c4137 100644 --- a/tests/baselines/reference/declarationEmitObjectAssignedDefaultExport.types +++ b/tests/baselines/reference/declarationEmitObjectAssignedDefaultExport.types @@ -77,10 +77,10 @@ export const C = styled.div``; >`` : "" export default Object.assign(A, { ->Object.assign(A, { B, C}) : string & import("tests/cases/compiler/node_modules/styled-components/index").StyledComponentBase<"div", import("tests/cases/compiler/node_modules/styled-components/index").DefaultTheme, {}, never> & import("tests/cases/compiler/node_modules/styled-components/node_modules/hoist-non-react-statics/index").NonReactStatics<"div"> & { B: import("tests/cases/compiler/node_modules/styled-components/index").StyledComponent<"div", import("tests/cases/compiler/node_modules/styled-components/index").DefaultTheme, {}, never>; C: import("tests/cases/compiler/node_modules/styled-components/index").StyledComponent<"div", import("tests/cases/compiler/node_modules/styled-components/index").DefaultTheme, {}, never>; } ->Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>Object.assign(A, { B, C}) : string & import("tests/cases/compiler/node_modules/styled-components/index").StyledComponentBase<"div", import("tests/cases/compiler/node_modules/styled-components/index").DefaultTheme, {}, never> & import("tests/cases/compiler/node_modules/styled-components/node_modules/hoist-non-react-statics/index").NonReactStatics<"div"> & Writable<{ B: import("tests/cases/compiler/node_modules/styled-components/index").StyledComponent<"div", import("tests/cases/compiler/node_modules/styled-components/index").DefaultTheme, {}, never>; C: import("tests/cases/compiler/node_modules/styled-components/index").StyledComponent<"div", import("tests/cases/compiler/node_modules/styled-components/index").DefaultTheme, {}, never>; }> +>Object.assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } >Object : ObjectConstructor ->assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } >A : import("tests/cases/compiler/node_modules/styled-components/index").StyledComponent<"div", import("tests/cases/compiler/node_modules/styled-components/index").DefaultTheme, {}, never> >{ B, C} : { B: import("tests/cases/compiler/node_modules/styled-components/index").StyledComponent<"div", import("tests/cases/compiler/node_modules/styled-components/index").DefaultTheme, {}, never>; C: import("tests/cases/compiler/node_modules/styled-components/index").StyledComponent<"div", import("tests/cases/compiler/node_modules/styled-components/index").DefaultTheme, {}, never>; } diff --git a/tests/baselines/reference/declarationsWithRecursiveInternalTypesProduceUniqueTypeParams.js b/tests/baselines/reference/declarationsWithRecursiveInternalTypesProduceUniqueTypeParams.js index fe06d05e0d70f..5e860b7585718 100644 --- a/tests/baselines/reference/declarationsWithRecursiveInternalTypesProduceUniqueTypeParams.js +++ b/tests/baselines/reference/declarationsWithRecursiveInternalTypesProduceUniqueTypeParams.js @@ -94,43 +94,43 @@ void p3.result.three; //// [declarationsWithRecursiveInternalTypesProduceUniqueTypeParams.d.ts] export type Key = keyof U; export type Value, U> = U[K]; -export declare const updateIfChanged: (t: T) => ((key: K) => (>(key: K_1) => (>>(key: K_2) => (>>>(key: K_3) => (>>>>(key: K_4) => (>>>>>(key: K_5) => (>>>>>>(key: K_6) => (>>>>>>>(key: K_7) => (>>>>>>>>(key: K_8) => (>>>>>>>>>(key: K_9) => (>>>>>>>>>>(key: K_10) => any & { +export declare const updateIfChanged: (t: T) => ((key: K) => (>(key: K_1) => (>>(key: K_2) => (>>>(key: K_3) => (>>>>(key: K_4) => (>>>>>(key: K_5) => (>>>>>>(key: K_6) => (>>>>>>>(key: K_7) => (>>>>>>>>(key: K_8) => (>>>>>>>>>(key: K_9) => (>>>>>>>>>>(key: K_10) => any & Writable<{ map: (updater: (u: Value>>>>>>>>>>) => Value>>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>>) => T; -}) & { +}>) & Writable<{ map: (updater: (u: Value>>>>>>>>>) => Value>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>) => T; -}) & { +}>) & Writable<{ map: (updater: (u: Value>>>>>>>>) => Value>>>>>>>>) => T; set: (newU: Value>>>>>>>>) => T; -}) & { +}>) & Writable<{ map: (updater: (u: Value>>>>>>>) => Value>>>>>>>) => T; set: (newU: Value>>>>>>>) => T; -}) & { +}>) & Writable<{ map: (updater: (u: Value>>>>>>) => Value>>>>>>) => T; set: (newU: Value>>>>>>) => T; -}) & { +}>) & Writable<{ map: (updater: (u: Value>>>>>) => Value>>>>>) => T; set: (newU: Value>>>>>) => T; -}) & { +}>) & Writable<{ map: (updater: (u: Value>>>>) => Value>>>>) => T; set: (newU: Value>>>>) => T; -}) & { +}>) & Writable<{ map: (updater: (u: Value>>>) => Value>>>) => T; set: (newU: Value>>>) => T; -}) & { +}>) & Writable<{ map: (updater: (u: Value>>) => Value>>) => T; set: (newU: Value>>) => T; -}) & { +}>) & Writable<{ map: (updater: (u: Value>) => Value>) => T; set: (newU: Value>) => T; -}) & { +}>) & Writable<{ map: (updater: (u: Value) => Value) => T; set: (newU: Value) => T; -}) & { +}>) & Writable<{ map: (updater: (u: T) => T) => T; set: (newU: T) => T; -}; +}>; export declare const testRecFun: (parent: T) => { result: T; deeper: (child: U) => { diff --git a/tests/baselines/reference/declarationsWithRecursiveInternalTypesProduceUniqueTypeParams.symbols b/tests/baselines/reference/declarationsWithRecursiveInternalTypesProduceUniqueTypeParams.symbols index 08c4eccca0829..bfbdd6084157c 100644 --- a/tests/baselines/reference/declarationsWithRecursiveInternalTypesProduceUniqueTypeParams.symbols +++ b/tests/baselines/reference/declarationsWithRecursiveInternalTypesProduceUniqueTypeParams.symbols @@ -47,9 +47,9 @@ export const updateIfChanged = (t: T) => { >newU : Symbol(newU, Decl(declarationsWithRecursiveInternalTypesProduceUniqueTypeParams.ts, 8, 21)) return Object.assign( ->Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >(key: K) => >K : Symbol(K, Decl(declarationsWithRecursiveInternalTypesProduceUniqueTypeParams.ts, 10, 13)) @@ -76,9 +76,9 @@ export const updateIfChanged = (t: T) => { return update(Object.assign(Array.isArray(u) ? [] : {}, u, { [key]: v })); >update : Symbol(update, Decl(declarationsWithRecursiveInternalTypesProduceUniqueTypeParams.ts, 7, 28)) ->Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Array.isArray : Symbol(ArrayConstructor.isArray, Decl(lib.es5.d.ts, --, --)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >isArray : Symbol(ArrayConstructor.isArray, Decl(lib.es5.d.ts, --, --)) diff --git a/tests/baselines/reference/declarationsWithRecursiveInternalTypesProduceUniqueTypeParams.types b/tests/baselines/reference/declarationsWithRecursiveInternalTypesProduceUniqueTypeParams.types index 4e4bf5b76933a..1bef7f2379546 100644 --- a/tests/baselines/reference/declarationsWithRecursiveInternalTypesProduceUniqueTypeParams.types +++ b/tests/baselines/reference/declarationsWithRecursiveInternalTypesProduceUniqueTypeParams.types @@ -10,13 +10,13 @@ export type Value, U> = U[K]; >Value : Value export const updateIfChanged = (t: T) => { ->updateIfChanged : (t: T) => ((key: K) => (>(key: K) => (>>(key: K) => (>>>(key: K) => (>>>>(key: K) => (>>>>>(key: K) => (>>>>>>(key: K) => (>>>>>>>(key: K) => (>>>>>>>>(key: K) => (>>>>>>>>>(key: K) => (>>>>>>>>>>(key: K) => any & { map: (updater: (u: Value>>>>>>>>>>) => Value>>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>>>) => Value>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>>) => Value>>>>>>>>) => T; set: (newU: Value>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>) => Value>>>>>>>) => T; set: (newU: Value>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>) => Value>>>>>>) => T; set: (newU: Value>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>) => Value>>>>>) => T; set: (newU: Value>>>>>) => T; }) & { map: (updater: (u: Value>>>>) => Value>>>>) => T; set: (newU: Value>>>>) => T; }) & { map: (updater: (u: Value>>>) => Value>>>) => T; set: (newU: Value>>>) => T; }) & { map: (updater: (u: Value>>) => Value>>) => T; set: (newU: Value>>) => T; }) & { map: (updater: (u: Value>) => Value>) => T; set: (newU: Value>) => T; }) & { map: (updater: (u: Value) => Value) => T; set: (newU: Value) => T; }) & { map: (updater: (u: T) => T) => T; set: (newU: T) => T; } ->(t: T) => { const reduce = (u: U, update: (u: U) => T) => { const set = (newU: U) => Object.is(u, newU) ? t : update(newU); return Object.assign( >(key: K) => reduce>(u[key as keyof U] as Value, (v: Value) => { return update(Object.assign(Array.isArray(u) ? [] : {}, u, { [key]: v })); }), { map: (updater: (u: U) => U) => set(updater(u)), set }); }; return reduce(t, (t: T) => t);} : (t: T) => ((key: K) => (>(key: K) => (>>(key: K) => (>>>(key: K) => (>>>>(key: K) => (>>>>>(key: K) => (>>>>>>(key: K) => (>>>>>>>(key: K) => (>>>>>>>>(key: K) => (>>>>>>>>>(key: K) => (>>>>>>>>>>(key: K) => any & { map: (updater: (u: Value>>>>>>>>>>) => Value>>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>>>) => Value>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>>) => Value>>>>>>>>) => T; set: (newU: Value>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>) => Value>>>>>>>) => T; set: (newU: Value>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>) => Value>>>>>>) => T; set: (newU: Value>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>) => Value>>>>>) => T; set: (newU: Value>>>>>) => T; }) & { map: (updater: (u: Value>>>>) => Value>>>>) => T; set: (newU: Value>>>>) => T; }) & { map: (updater: (u: Value>>>) => Value>>>) => T; set: (newU: Value>>>) => T; }) & { map: (updater: (u: Value>>) => Value>>) => T; set: (newU: Value>>) => T; }) & { map: (updater: (u: Value>) => Value>) => T; set: (newU: Value>) => T; }) & { map: (updater: (u: Value) => Value) => T; set: (newU: Value) => T; }) & { map: (updater: (u: T) => T) => T; set: (newU: T) => T; } +>updateIfChanged : (t: T) => ((key: K) => (>(key: K) => (>>(key: K) => (>>>(key: K) => (>>>>(key: K) => (>>>>>(key: K) => (>>>>>>(key: K) => (>>>>>>>(key: K) => (>>>>>>>>(key: K) => (>>>>>>>>>(key: K) => (>>>>>>>>>>(key: K) => any & Writable<{ map: (updater: (u: Value>>>>>>>>>>) => Value>>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>>>) => Value>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>>) => Value>>>>>>>>) => T; set: (newU: Value>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>) => Value>>>>>>>) => T; set: (newU: Value>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>) => Value>>>>>>) => T; set: (newU: Value>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>) => Value>>>>>) => T; set: (newU: Value>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>) => Value>>>>) => T; set: (newU: Value>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>) => Value>>>) => T; set: (newU: Value>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>) => Value>>) => T; set: (newU: Value>>) => T; }>) & Writable<{ map: (updater: (u: Value>) => Value>) => T; set: (newU: Value>) => T; }>) & Writable<{ map: (updater: (u: Value) => Value) => T; set: (newU: Value) => T; }>) & Writable<{ map: (updater: (u: T) => T) => T; set: (newU: T) => T; }> +>(t: T) => { const reduce = (u: U, update: (u: U) => T) => { const set = (newU: U) => Object.is(u, newU) ? t : update(newU); return Object.assign( >(key: K) => reduce>(u[key as keyof U] as Value, (v: Value) => { return update(Object.assign(Array.isArray(u) ? [] : {}, u, { [key]: v })); }), { map: (updater: (u: U) => U) => set(updater(u)), set }); }; return reduce(t, (t: T) => t);} : (t: T) => ((key: K) => (>(key: K) => (>>(key: K) => (>>>(key: K) => (>>>>(key: K) => (>>>>>(key: K) => (>>>>>>(key: K) => (>>>>>>>(key: K) => (>>>>>>>>(key: K) => (>>>>>>>>>(key: K) => (>>>>>>>>>>(key: K) => any & Writable<{ map: (updater: (u: Value>>>>>>>>>>) => Value>>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>>>) => Value>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>>) => Value>>>>>>>>) => T; set: (newU: Value>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>) => Value>>>>>>>) => T; set: (newU: Value>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>) => Value>>>>>>) => T; set: (newU: Value>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>) => Value>>>>>) => T; set: (newU: Value>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>) => Value>>>>) => T; set: (newU: Value>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>) => Value>>>) => T; set: (newU: Value>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>) => Value>>) => T; set: (newU: Value>>) => T; }>) & Writable<{ map: (updater: (u: Value>) => Value>) => T; set: (newU: Value>) => T; }>) & Writable<{ map: (updater: (u: Value) => Value) => T; set: (newU: Value) => T; }>) & Writable<{ map: (updater: (u: T) => T) => T; set: (newU: T) => T; }> >t : T const reduce = (u: U, update: (u: U) => T) => { ->reduce : (u: U, update: (u: U) => T) => ((key: K) => (>(key: K) => (>>(key: K) => (>>>(key: K) => (>>>>(key: K) => (>>>>>(key: K) => (>>>>>>(key: K) => (>>>>>>>(key: K) => (>>>>>>>>(key: K) => (>>>>>>>>>(key: K) => (>>>>>>>>>>(key: K) => any & { map: (updater: (u: Value>>>>>>>>>>) => Value>>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>>>) => Value>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>>) => Value>>>>>>>>) => T; set: (newU: Value>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>) => Value>>>>>>>) => T; set: (newU: Value>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>) => Value>>>>>>) => T; set: (newU: Value>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>) => Value>>>>>) => T; set: (newU: Value>>>>>) => T; }) & { map: (updater: (u: Value>>>>) => Value>>>>) => T; set: (newU: Value>>>>) => T; }) & { map: (updater: (u: Value>>>) => Value>>>) => T; set: (newU: Value>>>) => T; }) & { map: (updater: (u: Value>>) => Value>>) => T; set: (newU: Value>>) => T; }) & { map: (updater: (u: Value>) => Value>) => T; set: (newU: Value>) => T; }) & { map: (updater: (u: Value) => Value) => T; set: (newU: Value) => T; }) & { map: (updater: (u: U) => U) => T; set: (newU: U) => T; } ->(u: U, update: (u: U) => T) => { const set = (newU: U) => Object.is(u, newU) ? t : update(newU); return Object.assign( >(key: K) => reduce>(u[key as keyof U] as Value, (v: Value) => { return update(Object.assign(Array.isArray(u) ? [] : {}, u, { [key]: v })); }), { map: (updater: (u: U) => U) => set(updater(u)), set }); } : (u: U, update: (u: U) => T) => ((key: K) => (>(key: K) => (>>(key: K) => (>>>(key: K) => (>>>>(key: K) => (>>>>>(key: K) => (>>>>>>(key: K) => (>>>>>>>(key: K) => (>>>>>>>>(key: K) => (>>>>>>>>>(key: K) => (>>>>>>>>>>(key: K) => any & { map: (updater: (u: Value>>>>>>>>>>) => Value>>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>>>) => Value>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>>) => Value>>>>>>>>) => T; set: (newU: Value>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>) => Value>>>>>>>) => T; set: (newU: Value>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>) => Value>>>>>>) => T; set: (newU: Value>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>) => Value>>>>>) => T; set: (newU: Value>>>>>) => T; }) & { map: (updater: (u: Value>>>>) => Value>>>>) => T; set: (newU: Value>>>>) => T; }) & { map: (updater: (u: Value>>>) => Value>>>) => T; set: (newU: Value>>>) => T; }) & { map: (updater: (u: Value>>) => Value>>) => T; set: (newU: Value>>) => T; }) & { map: (updater: (u: Value>) => Value>) => T; set: (newU: Value>) => T; }) & { map: (updater: (u: Value) => Value) => T; set: (newU: Value) => T; }) & { map: (updater: (u: U) => U) => T; set: (newU: U) => T; } +>reduce : (u: U, update: (u: U) => T) => ((key: K) => (>(key: K) => (>>(key: K) => (>>>(key: K) => (>>>>(key: K) => (>>>>>(key: K) => (>>>>>>(key: K) => (>>>>>>>(key: K) => (>>>>>>>>(key: K) => (>>>>>>>>>(key: K) => (>>>>>>>>>>(key: K) => any & Writable<{ map: (updater: (u: Value>>>>>>>>>>) => Value>>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>>>) => Value>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>>) => Value>>>>>>>>) => T; set: (newU: Value>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>) => Value>>>>>>>) => T; set: (newU: Value>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>) => Value>>>>>>) => T; set: (newU: Value>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>) => Value>>>>>) => T; set: (newU: Value>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>) => Value>>>>) => T; set: (newU: Value>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>) => Value>>>) => T; set: (newU: Value>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>) => Value>>) => T; set: (newU: Value>>) => T; }>) & Writable<{ map: (updater: (u: Value>) => Value>) => T; set: (newU: Value>) => T; }>) & Writable<{ map: (updater: (u: Value) => Value) => T; set: (newU: Value) => T; }>) & Writable<{ map: (updater: (u: U) => U) => T; set: (newU: U) => T; }> +>(u: U, update: (u: U) => T) => { const set = (newU: U) => Object.is(u, newU) ? t : update(newU); return Object.assign( >(key: K) => reduce>(u[key as keyof U] as Value, (v: Value) => { return update(Object.assign(Array.isArray(u) ? [] : {}, u, { [key]: v })); }), { map: (updater: (u: U) => U) => set(updater(u)), set }); } : (u: U, update: (u: U) => T) => ((key: K) => (>(key: K) => (>>(key: K) => (>>>(key: K) => (>>>>(key: K) => (>>>>>(key: K) => (>>>>>>(key: K) => (>>>>>>>(key: K) => (>>>>>>>>(key: K) => (>>>>>>>>>(key: K) => (>>>>>>>>>>(key: K) => any & Writable<{ map: (updater: (u: Value>>>>>>>>>>) => Value>>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>>>) => Value>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>>) => Value>>>>>>>>) => T; set: (newU: Value>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>) => Value>>>>>>>) => T; set: (newU: Value>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>) => Value>>>>>>) => T; set: (newU: Value>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>) => Value>>>>>) => T; set: (newU: Value>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>) => Value>>>>) => T; set: (newU: Value>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>) => Value>>>) => T; set: (newU: Value>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>) => Value>>) => T; set: (newU: Value>>) => T; }>) & Writable<{ map: (updater: (u: Value>) => Value>) => T; set: (newU: Value>) => T; }>) & Writable<{ map: (updater: (u: Value) => Value) => T; set: (newU: Value) => T; }>) & Writable<{ map: (updater: (u: U) => U) => T; set: (newU: U) => T; }> >u : U >update : (u: U) => T >u : U @@ -38,18 +38,18 @@ export const updateIfChanged = (t: T) => { >newU : U return Object.assign( ->Object.assign( >(key: K) => reduce>(u[key as keyof U] as Value, (v: Value) => { return update(Object.assign(Array.isArray(u) ? [] : {}, u, { [key]: v })); }), { map: (updater: (u: U) => U) => set(updater(u)), set }) : ((key: K) => (>(key: K) => (>>(key: K) => (>>>(key: K) => (>>>>(key: K) => (>>>>>(key: K) => (>>>>>>(key: K) => (>>>>>>>(key: K) => (>>>>>>>>(key: K) => (>>>>>>>>>(key: K) => (>>>>>>>>>>(key: K) => any & { map: (updater: (u: Value>>>>>>>>>>) => Value>>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>>>) => Value>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>>) => Value>>>>>>>>) => T; set: (newU: Value>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>) => Value>>>>>>>) => T; set: (newU: Value>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>) => Value>>>>>>) => T; set: (newU: Value>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>) => Value>>>>>) => T; set: (newU: Value>>>>>) => T; }) & { map: (updater: (u: Value>>>>) => Value>>>>) => T; set: (newU: Value>>>>) => T; }) & { map: (updater: (u: Value>>>) => Value>>>) => T; set: (newU: Value>>>) => T; }) & { map: (updater: (u: Value>>) => Value>>) => T; set: (newU: Value>>) => T; }) & { map: (updater: (u: Value>) => Value>) => T; set: (newU: Value>) => T; }) & { map: (updater: (u: Value) => Value) => T; set: (newU: Value) => T; }) & { map: (updater: (u: U) => U) => T; set: (newU: U) => T; } ->Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>Object.assign( >(key: K) => reduce>(u[key as keyof U] as Value, (v: Value) => { return update(Object.assign(Array.isArray(u) ? [] : {}, u, { [key]: v })); }), { map: (updater: (u: U) => U) => set(updater(u)), set }) : ((key: K) => (>(key: K) => (>>(key: K) => (>>>(key: K) => (>>>>(key: K) => (>>>>>(key: K) => (>>>>>>(key: K) => (>>>>>>>(key: K) => (>>>>>>>>(key: K) => (>>>>>>>>>(key: K) => (>>>>>>>>>>(key: K) => any & Writable<{ map: (updater: (u: Value>>>>>>>>>>) => Value>>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>>>) => Value>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>>) => Value>>>>>>>>) => T; set: (newU: Value>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>) => Value>>>>>>>) => T; set: (newU: Value>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>) => Value>>>>>>) => T; set: (newU: Value>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>) => Value>>>>>) => T; set: (newU: Value>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>) => Value>>>>) => T; set: (newU: Value>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>) => Value>>>) => T; set: (newU: Value>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>) => Value>>) => T; set: (newU: Value>>) => T; }>) & Writable<{ map: (updater: (u: Value>) => Value>) => T; set: (newU: Value>) => T; }>) & Writable<{ map: (updater: (u: Value) => Value) => T; set: (newU: Value) => T; }>) & Writable<{ map: (updater: (u: U) => U) => T; set: (newU: U) => T; }> +>Object.assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } >Object : ObjectConstructor ->assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } >(key: K) => ->>(key: K) => reduce>(u[key as keyof U] as Value, (v: Value) => { return update(Object.assign(Array.isArray(u) ? [] : {}, u, { [key]: v })); }) : (key: K) => (>(key: K) => (>>(key: K) => (>>>(key: K) => (>>>>(key: K) => (>>>>>(key: K) => (>>>>>>(key: K) => (>>>>>>>(key: K) => (>>>>>>>>(key: K) => (>>>>>>>>>(key: K) => (>>>>>>>>>>(key: K) => any & { map: (updater: (u: Value>>>>>>>>>>) => Value>>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>>>) => Value>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>>) => Value>>>>>>>>) => T; set: (newU: Value>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>) => Value>>>>>>>) => T; set: (newU: Value>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>) => Value>>>>>>) => T; set: (newU: Value>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>) => Value>>>>>) => T; set: (newU: Value>>>>>) => T; }) & { map: (updater: (u: Value>>>>) => Value>>>>) => T; set: (newU: Value>>>>) => T; }) & { map: (updater: (u: Value>>>) => Value>>>) => T; set: (newU: Value>>>) => T; }) & { map: (updater: (u: Value>>) => Value>>) => T; set: (newU: Value>>) => T; }) & { map: (updater: (u: Value>) => Value>) => T; set: (newU: Value>) => T; }) & { map: (updater: (u: Value) => Value) => T; set: (newU: Value) => T; } +>>(key: K) => reduce>(u[key as keyof U] as Value, (v: Value) => { return update(Object.assign(Array.isArray(u) ? [] : {}, u, { [key]: v })); }) : (key: K) => (>(key: K) => (>>(key: K) => (>>>(key: K) => (>>>>(key: K) => (>>>>>(key: K) => (>>>>>>(key: K) => (>>>>>>>(key: K) => (>>>>>>>>(key: K) => (>>>>>>>>>(key: K) => (>>>>>>>>>>(key: K) => any & Writable<{ map: (updater: (u: Value>>>>>>>>>>) => Value>>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>>>) => Value>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>>) => Value>>>>>>>>) => T; set: (newU: Value>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>) => Value>>>>>>>) => T; set: (newU: Value>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>) => Value>>>>>>) => T; set: (newU: Value>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>) => Value>>>>>) => T; set: (newU: Value>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>) => Value>>>>) => T; set: (newU: Value>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>) => Value>>>) => T; set: (newU: Value>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>) => Value>>) => T; set: (newU: Value>>) => T; }>) & Writable<{ map: (updater: (u: Value>) => Value>) => T; set: (newU: Value>) => T; }>) & Writable<{ map: (updater: (u: Value) => Value) => T; set: (newU: Value) => T; }> >key : K reduce>(u[key as keyof U] as Value, (v: Value) => { ->reduce>(u[key as keyof U] as Value, (v: Value) => { return update(Object.assign(Array.isArray(u) ? [] : {}, u, { [key]: v })); }) : (>(key: K) => (>>(key: K) => (>>>(key: K) => (>>>>(key: K) => (>>>>>(key: K) => (>>>>>>(key: K) => (>>>>>>>(key: K) => (>>>>>>>>(key: K) => (>>>>>>>>>(key: K) => (>>>>>>>>>>(key: K) => (>>>>>>>>>>>(key: K) => any & { map: (updater: (u: Value>>>>>>>>>>>) => Value>>>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>>>>) => Value>>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>>>) => Value>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>>) => Value>>>>>>>>) => T; set: (newU: Value>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>) => Value>>>>>>>) => T; set: (newU: Value>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>) => Value>>>>>>) => T; set: (newU: Value>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>) => Value>>>>>) => T; set: (newU: Value>>>>>) => T; }) & { map: (updater: (u: Value>>>>) => Value>>>>) => T; set: (newU: Value>>>>) => T; }) & { map: (updater: (u: Value>>>) => Value>>>) => T; set: (newU: Value>>>) => T; }) & { map: (updater: (u: Value>>) => Value>>) => T; set: (newU: Value>>) => T; }) & { map: (updater: (u: Value>) => Value>) => T; set: (newU: Value>) => T; }) & { map: (updater: (u: Value) => Value) => T; set: (newU: Value) => T; } ->reduce : (u: U, update: (u: U) => T) => ((key: K) => (>(key: K) => (>>(key: K) => (>>>(key: K) => (>>>>(key: K) => (>>>>>(key: K) => (>>>>>>(key: K) => (>>>>>>>(key: K) => (>>>>>>>>(key: K) => (>>>>>>>>>(key: K) => (>>>>>>>>>>(key: K) => any & { map: (updater: (u: Value>>>>>>>>>>) => Value>>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>>>) => Value>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>>) => Value>>>>>>>>) => T; set: (newU: Value>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>) => Value>>>>>>>) => T; set: (newU: Value>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>) => Value>>>>>>) => T; set: (newU: Value>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>) => Value>>>>>) => T; set: (newU: Value>>>>>) => T; }) & { map: (updater: (u: Value>>>>) => Value>>>>) => T; set: (newU: Value>>>>) => T; }) & { map: (updater: (u: Value>>>) => Value>>>) => T; set: (newU: Value>>>) => T; }) & { map: (updater: (u: Value>>) => Value>>) => T; set: (newU: Value>>) => T; }) & { map: (updater: (u: Value>) => Value>) => T; set: (newU: Value>) => T; }) & { map: (updater: (u: Value) => Value) => T; set: (newU: Value) => T; }) & { map: (updater: (u: U) => U) => T; set: (newU: U) => T; } +>reduce>(u[key as keyof U] as Value, (v: Value) => { return update(Object.assign(Array.isArray(u) ? [] : {}, u, { [key]: v })); }) : (>(key: K) => (>>(key: K) => (>>>(key: K) => (>>>>(key: K) => (>>>>>(key: K) => (>>>>>>(key: K) => (>>>>>>>(key: K) => (>>>>>>>>(key: K) => (>>>>>>>>>(key: K) => (>>>>>>>>>>(key: K) => (>>>>>>>>>>>(key: K) => any & Writable<{ map: (updater: (u: Value>>>>>>>>>>>) => Value>>>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>>>>) => Value>>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>>>) => Value>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>>) => Value>>>>>>>>) => T; set: (newU: Value>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>) => Value>>>>>>>) => T; set: (newU: Value>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>) => Value>>>>>>) => T; set: (newU: Value>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>) => Value>>>>>) => T; set: (newU: Value>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>) => Value>>>>) => T; set: (newU: Value>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>) => Value>>>) => T; set: (newU: Value>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>) => Value>>) => T; set: (newU: Value>>) => T; }>) & Writable<{ map: (updater: (u: Value>) => Value>) => T; set: (newU: Value>) => T; }>) & Writable<{ map: (updater: (u: Value) => Value) => T; set: (newU: Value) => T; }> +>reduce : (u: U, update: (u: U) => T) => ((key: K) => (>(key: K) => (>>(key: K) => (>>>(key: K) => (>>>>(key: K) => (>>>>>(key: K) => (>>>>>>(key: K) => (>>>>>>>(key: K) => (>>>>>>>>(key: K) => (>>>>>>>>>(key: K) => (>>>>>>>>>>(key: K) => any & Writable<{ map: (updater: (u: Value>>>>>>>>>>) => Value>>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>>>) => Value>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>>) => Value>>>>>>>>) => T; set: (newU: Value>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>) => Value>>>>>>>) => T; set: (newU: Value>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>) => Value>>>>>>) => T; set: (newU: Value>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>) => Value>>>>>) => T; set: (newU: Value>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>) => Value>>>>) => T; set: (newU: Value>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>) => Value>>>) => T; set: (newU: Value>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>) => Value>>) => T; set: (newU: Value>>) => T; }>) & Writable<{ map: (updater: (u: Value>) => Value>) => T; set: (newU: Value>) => T; }>) & Writable<{ map: (updater: (u: Value) => Value) => T; set: (newU: Value) => T; }>) & Writable<{ map: (updater: (u: U) => U) => T; set: (newU: U) => T; }> >u[key as keyof U] as Value : Value >u[key as keyof U] : U[keyof U] >u : U @@ -61,10 +61,10 @@ export const updateIfChanged = (t: T) => { return update(Object.assign(Array.isArray(u) ? [] : {}, u, { [key]: v })); >update(Object.assign(Array.isArray(u) ? [] : {}, u, { [key]: v })) : T >update : (u: U) => T ->Object.assign(Array.isArray(u) ? [] : {}, u, { [key]: v }) : U & { [x: string]: Value; } ->Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>Object.assign(Array.isArray(u) ? [] : {}, u, { [key]: v }) : Writable & Writable<{ [x: string]: Value; }> +>Object.assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } >Object : ObjectConstructor ->assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } >Array.isArray(u) ? [] : {} : undefined[] | {} >Array.isArray(u) : boolean >Array.isArray : (arg: any) => arg is any[] @@ -95,8 +95,8 @@ export const updateIfChanged = (t: T) => { }; return reduce(t, (t: T) => t); ->reduce(t, (t: T) => t) : ((key: K) => (>(key: K) => (>>(key: K) => (>>>(key: K) => (>>>>(key: K) => (>>>>>(key: K) => (>>>>>>(key: K) => (>>>>>>>(key: K) => (>>>>>>>>(key: K) => (>>>>>>>>>(key: K) => (>>>>>>>>>>(key: K) => any & { map: (updater: (u: Value>>>>>>>>>>) => Value>>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>>>) => Value>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>>) => Value>>>>>>>>) => T; set: (newU: Value>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>) => Value>>>>>>>) => T; set: (newU: Value>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>) => Value>>>>>>) => T; set: (newU: Value>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>) => Value>>>>>) => T; set: (newU: Value>>>>>) => T; }) & { map: (updater: (u: Value>>>>) => Value>>>>) => T; set: (newU: Value>>>>) => T; }) & { map: (updater: (u: Value>>>) => Value>>>) => T; set: (newU: Value>>>) => T; }) & { map: (updater: (u: Value>>) => Value>>) => T; set: (newU: Value>>) => T; }) & { map: (updater: (u: Value>) => Value>) => T; set: (newU: Value>) => T; }) & { map: (updater: (u: Value) => Value) => T; set: (newU: Value) => T; }) & { map: (updater: (u: T) => T) => T; set: (newU: T) => T; } ->reduce : (u: U, update: (u: U) => T) => ((key: K) => (>(key: K) => (>>(key: K) => (>>>(key: K) => (>>>>(key: K) => (>>>>>(key: K) => (>>>>>>(key: K) => (>>>>>>>(key: K) => (>>>>>>>>(key: K) => (>>>>>>>>>(key: K) => (>>>>>>>>>>(key: K) => any & { map: (updater: (u: Value>>>>>>>>>>) => Value>>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>>>) => Value>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>>) => Value>>>>>>>>) => T; set: (newU: Value>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>) => Value>>>>>>>) => T; set: (newU: Value>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>) => Value>>>>>>) => T; set: (newU: Value>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>) => Value>>>>>) => T; set: (newU: Value>>>>>) => T; }) & { map: (updater: (u: Value>>>>) => Value>>>>) => T; set: (newU: Value>>>>) => T; }) & { map: (updater: (u: Value>>>) => Value>>>) => T; set: (newU: Value>>>) => T; }) & { map: (updater: (u: Value>>) => Value>>) => T; set: (newU: Value>>) => T; }) & { map: (updater: (u: Value>) => Value>) => T; set: (newU: Value>) => T; }) & { map: (updater: (u: Value) => Value) => T; set: (newU: Value) => T; }) & { map: (updater: (u: U) => U) => T; set: (newU: U) => T; } +>reduce(t, (t: T) => t) : ((key: K) => (>(key: K) => (>>(key: K) => (>>>(key: K) => (>>>>(key: K) => (>>>>>(key: K) => (>>>>>>(key: K) => (>>>>>>>(key: K) => (>>>>>>>>(key: K) => (>>>>>>>>>(key: K) => (>>>>>>>>>>(key: K) => any & Writable<{ map: (updater: (u: Value>>>>>>>>>>) => Value>>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>>>) => Value>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>>) => Value>>>>>>>>) => T; set: (newU: Value>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>) => Value>>>>>>>) => T; set: (newU: Value>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>) => Value>>>>>>) => T; set: (newU: Value>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>) => Value>>>>>) => T; set: (newU: Value>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>) => Value>>>>) => T; set: (newU: Value>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>) => Value>>>) => T; set: (newU: Value>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>) => Value>>) => T; set: (newU: Value>>) => T; }>) & Writable<{ map: (updater: (u: Value>) => Value>) => T; set: (newU: Value>) => T; }>) & Writable<{ map: (updater: (u: Value) => Value) => T; set: (newU: Value) => T; }>) & Writable<{ map: (updater: (u: T) => T) => T; set: (newU: T) => T; }> +>reduce : (u: U, update: (u: U) => T) => ((key: K) => (>(key: K) => (>>(key: K) => (>>>(key: K) => (>>>>(key: K) => (>>>>>(key: K) => (>>>>>>(key: K) => (>>>>>>>(key: K) => (>>>>>>>>(key: K) => (>>>>>>>>>(key: K) => (>>>>>>>>>>(key: K) => any & Writable<{ map: (updater: (u: Value>>>>>>>>>>) => Value>>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>>>) => Value>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>>) => Value>>>>>>>>) => T; set: (newU: Value>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>) => Value>>>>>>>) => T; set: (newU: Value>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>) => Value>>>>>>) => T; set: (newU: Value>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>) => Value>>>>>) => T; set: (newU: Value>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>) => Value>>>>) => T; set: (newU: Value>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>) => Value>>>) => T; set: (newU: Value>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>) => Value>>) => T; set: (newU: Value>>) => T; }>) & Writable<{ map: (updater: (u: Value>) => Value>) => T; set: (newU: Value>) => T; }>) & Writable<{ map: (updater: (u: Value) => Value) => T; set: (newU: Value) => T; }>) & Writable<{ map: (updater: (u: U) => U) => T; set: (newU: U) => T; }> >t : T >(t: T) => t : (t: T) => T >t : T diff --git a/tests/baselines/reference/destructuringParameterDeclaration4.errors.txt b/tests/baselines/reference/destructuringParameterDeclaration4.errors.txt index bb7aff5eb0fc0..a351f3d5fed32 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration4.errors.txt +++ b/tests/baselines/reference/destructuringParameterDeclaration4.errors.txt @@ -41,7 +41,7 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts( a1(...array2); // Error parameter type is (number|string)[] ~~~~~~ !!! error TS2552: Cannot find name 'array2'. Did you mean 'Array'? -!!! related TS2728 /.ts/lib.es5.d.ts:1490:13: 'Array' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1508:13: 'Array' is declared here. a5([1, 2, "string", false, true]); // Error, parameter type is [any, any, [[any]]] ~~~~~~~~ !!! error TS2322: Type 'string' is not assignable to type '[[any]]'. diff --git a/tests/baselines/reference/destructuringTuple.errors.txt b/tests/baselines/reference/destructuringTuple.errors.txt index e8548783cafc4..1648a635d8143 100644 --- a/tests/baselines/reference/destructuringTuple.errors.txt +++ b/tests/baselines/reference/destructuringTuple.errors.txt @@ -33,8 +33,8 @@ tests/cases/compiler/destructuringTuple.ts(11,60): error TS2769: No overload mat !!! error TS2769: Overload 2 of 3, '(callbackfn: (previousValue: [], currentValue: number, currentIndex: number, array: number[]) => [], initialValue: []): []', gave the following error. !!! error TS2769: Type 'never[]' is not assignable to type '[]'. !!! error TS2769: Target allows only 0 element(s) but source may have more. -!!! related TS6502 /.ts/lib.es5.d.ts:1455:24: The expected type comes from the return type of this signature. -!!! related TS6502 /.ts/lib.es5.d.ts:1461:27: The expected type comes from the return type of this signature. +!!! related TS6502 /.ts/lib.es5.d.ts:1473:24: The expected type comes from the return type of this signature. +!!! related TS6502 /.ts/lib.es5.d.ts:1479:27: The expected type comes from the return type of this signature. ~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(...items: ConcatArray[]): never[]', gave the following error. diff --git a/tests/baselines/reference/duplicateNumericIndexers.errors.txt b/tests/baselines/reference/duplicateNumericIndexers.errors.txt index b149e6f586d06..1e237c89f0f2b 100644 --- a/tests/baselines/reference/duplicateNumericIndexers.errors.txt +++ b/tests/baselines/reference/duplicateNumericIndexers.errors.txt @@ -10,8 +10,8 @@ tests/cases/conformance/types/members/duplicateNumericIndexers.ts(24,5): error T tests/cases/conformance/types/members/duplicateNumericIndexers.ts(25,5): error TS2374: Duplicate index signature for type 'number'. tests/cases/conformance/types/members/duplicateNumericIndexers.ts(29,5): error TS2374: Duplicate index signature for type 'number'. tests/cases/conformance/types/members/duplicateNumericIndexers.ts(30,5): error TS2374: Duplicate index signature for type 'number'. -lib.es5.d.ts(517,5): error TS2374: Duplicate index signature for type 'number'. -lib.es5.d.ts(1476,5): error TS2374: Duplicate index signature for type 'number'. +lib.es5.d.ts(535,5): error TS2374: Duplicate index signature for type 'number'. +lib.es5.d.ts(1494,5): error TS2374: Duplicate index signature for type 'number'. ==== tests/cases/conformance/types/members/duplicateNumericIndexers.ts (12 errors) ==== diff --git a/tests/baselines/reference/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.types b/tests/baselines/reference/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.types index c566d1897b08d..cf4beacdfc810 100644 --- a/tests/baselines/reference/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.types +++ b/tests/baselines/reference/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.types @@ -14,9 +14,9 @@ module.exports = 12; Object.defineProperty(module, "exports", { value: "oh no" }); >Object.defineProperty(module, "exports", { value: "oh no" }) : typeof module ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >module : typeof module >"exports" : "exports" >{ value: "oh no" } : { value: string; } @@ -59,9 +59,9 @@ B.NS = require("./namespacey"); Object.defineProperty(B, "NS", { value: "why though", writable: true }); >Object.defineProperty(B, "NS", { value: "why though", writable: true }) : typeof B ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >B : typeof B >"NS" : "NS" >{ value: "why though", writable: true } : { value: string; writable: true; } diff --git a/tests/baselines/reference/es2018ObjectAssign.symbols b/tests/baselines/reference/es2018ObjectAssign.symbols index 3ed140cb570d3..3f27f2158d345 100644 --- a/tests/baselines/reference/es2018ObjectAssign.symbols +++ b/tests/baselines/reference/es2018ObjectAssign.symbols @@ -1,9 +1,9 @@ === tests/cases/compiler/es2018ObjectAssign.ts === const test = Object.assign({}, { test: true }); >test : Symbol(test, Decl(es2018ObjectAssign.ts, 0, 5)) ->Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >test : Symbol(test, Decl(es2018ObjectAssign.ts, 0, 32)) declare const p: Promise; diff --git a/tests/baselines/reference/es2018ObjectAssign.types b/tests/baselines/reference/es2018ObjectAssign.types index e8cc1927c5caf..7e85abc8fe285 100644 --- a/tests/baselines/reference/es2018ObjectAssign.types +++ b/tests/baselines/reference/es2018ObjectAssign.types @@ -1,10 +1,10 @@ === tests/cases/compiler/es2018ObjectAssign.ts === const test = Object.assign({}, { test: true }); ->test : { test: boolean; } ->Object.assign({}, { test: true }) : { test: boolean; } ->Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>test : Writable<{ test: boolean; }> +>Object.assign({}, { test: true }) : Writable<{ test: boolean; }> +>Object.assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } >Object : ObjectConstructor ->assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } >{} : {} >{ test: true } : { test: true; } >test : true diff --git a/tests/baselines/reference/esNextWeakRefs_IterableWeakMap.types b/tests/baselines/reference/esNextWeakRefs_IterableWeakMap.types index 79e54575127f7..8845f1a09b15a 100644 --- a/tests/baselines/reference/esNextWeakRefs_IterableWeakMap.types +++ b/tests/baselines/reference/esNextWeakRefs_IterableWeakMap.types @@ -307,9 +307,9 @@ export class IterableWeakMap implements WeakMap { Object.defineProperties(IterableWeakMap.prototype, { >Object.defineProperties(IterableWeakMap.prototype, { [Symbol.iterator]: { configurable: true, enumerable: false, writable: true, value: Object.getOwnPropertyDescriptor( IterableWeakMap.prototype, "entries", )!.value, }, [Symbol.toStringTag]: { configurable: true, enumerable: false, writable: false, value: "IterableWeakMap", },}) : IterableWeakMap ->Object.defineProperties : (o: T, properties: PropertyDescriptorMap & ThisType) => T +>Object.defineProperties : (o: T, properties: PropertyDescriptorMap & ThisType) => T >Object : ObjectConstructor ->defineProperties : (o: T, properties: PropertyDescriptorMap & ThisType) => T +>defineProperties : (o: T, properties: PropertyDescriptorMap & ThisType) => T >IterableWeakMap.prototype : IterableWeakMap >IterableWeakMap : typeof IterableWeakMap >prototype : IterableWeakMap @@ -339,9 +339,9 @@ Object.defineProperties(IterableWeakMap.prototype, { >Object.getOwnPropertyDescriptor( IterableWeakMap.prototype, "entries", )!.value : any >Object.getOwnPropertyDescriptor( IterableWeakMap.prototype, "entries", )! : PropertyDescriptor >Object.getOwnPropertyDescriptor( IterableWeakMap.prototype, "entries", ) : PropertyDescriptor | undefined ->Object.getOwnPropertyDescriptor : (o: any, p: PropertyKey) => PropertyDescriptor | undefined +>Object.getOwnPropertyDescriptor : (o: {}, p: PropertyKey) => PropertyDescriptor | undefined >Object : ObjectConstructor ->getOwnPropertyDescriptor : (o: any, p: PropertyKey) => PropertyDescriptor | undefined +>getOwnPropertyDescriptor : (o: {}, p: PropertyKey) => PropertyDescriptor | undefined IterableWeakMap.prototype, >IterableWeakMap.prototype : IterableWeakMap diff --git a/tests/baselines/reference/excessPropertyCheckWithEmptyObject.types b/tests/baselines/reference/excessPropertyCheckWithEmptyObject.types index 3c748f7fd923b..6e19f04737b72 100644 --- a/tests/baselines/reference/excessPropertyCheckWithEmptyObject.types +++ b/tests/baselines/reference/excessPropertyCheckWithEmptyObject.types @@ -4,9 +4,9 @@ // Excess property error expected here Object.defineProperty(window, "prop", { value: "v1.0.0", readonly: false }); >Object.defineProperty(window, "prop", { value: "v1.0.0", readonly: false }) : Window & typeof globalThis ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >window : Window & typeof globalThis >"prop" : "prop" >{ value: "v1.0.0", readonly: false } : { value: string; readonly: boolean; } diff --git a/tests/baselines/reference/externModule.errors.txt b/tests/baselines/reference/externModule.errors.txt index 134443d52d215..7ef99c007dae4 100644 --- a/tests/baselines/reference/externModule.errors.txt +++ b/tests/baselines/reference/externModule.errors.txt @@ -66,20 +66,20 @@ tests/cases/compiler/externModule.ts(37,3): error TS2552: Cannot find name 'XDat var d=new XDate(); ~~~~~ !!! error TS2552: Cannot find name 'XDate'. Did you mean 'Date'? -!!! related TS2728 /.ts/lib.es5.d.ts:937:13: 'Date' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:955:13: 'Date' is declared here. d.getDay(); d=new XDate(1978,2); ~~~~~ !!! error TS2552: Cannot find name 'XDate'. Did you mean 'Date'? -!!! related TS2728 /.ts/lib.es5.d.ts:937:13: 'Date' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:955:13: 'Date' is declared here. d.getXDate(); var n=XDate.parse("3/2/2004"); ~~~~~ !!! error TS2552: Cannot find name 'XDate'. Did you mean 'Date'? -!!! related TS2728 /.ts/lib.es5.d.ts:937:13: 'Date' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:955:13: 'Date' is declared here. n=XDate.UTC(1964,2,1); ~~~~~ !!! error TS2552: Cannot find name 'XDate'. Did you mean 'Date'? -!!! related TS2728 /.ts/lib.es5.d.ts:937:13: 'Date' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:955:13: 'Date' is declared here. \ No newline at end of file diff --git a/tests/baselines/reference/getterSetterNonAccessor.types b/tests/baselines/reference/getterSetterNonAccessor.types index 5f9a658b575f0..b81b5a6dcad1d 100644 --- a/tests/baselines/reference/getterSetterNonAccessor.types +++ b/tests/baselines/reference/getterSetterNonAccessor.types @@ -9,9 +9,9 @@ function setFunc(v){} Object.defineProperty({}, "0", ({ >Object.defineProperty({}, "0", ({ get: getFunc, set: setFunc, configurable: true })) : {} ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >{} : {} >"0" : "0" >({ get: getFunc, set: setFunc, configurable: true }) : PropertyDescriptor diff --git a/tests/baselines/reference/importAliasModuleExports.types b/tests/baselines/reference/importAliasModuleExports.types index 2067e8b8d74e4..982fbb7cfba05 100644 --- a/tests/baselines/reference/importAliasModuleExports.types +++ b/tests/baselines/reference/importAliasModuleExports.types @@ -42,9 +42,9 @@ A.prototype.func = function() { this._func = 0; } Object.defineProperty(A.prototype, "def", { value: 0 }); >Object.defineProperty(A.prototype, "def", { value: 0 }) : A ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >A.prototype : A >A : typeof A >prototype : A diff --git a/tests/baselines/reference/intersectionsAndEmptyObjects.symbols b/tests/baselines/reference/intersectionsAndEmptyObjects.symbols index 7cb08ebfb2523..94ee28962dbbc 100644 --- a/tests/baselines/reference/intersectionsAndEmptyObjects.symbols +++ b/tests/baselines/reference/intersectionsAndEmptyObjects.symbols @@ -116,9 +116,9 @@ const intersectDictionaries = ( ): F1 & F2 => Object.assign({}, d1, d2); >F1 : Symbol(F1, Decl(intersectionsAndEmptyObjects.ts, 30, 31)) >F2 : Symbol(F2, Decl(intersectionsAndEmptyObjects.ts, 30, 53)) ->Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >d1 : Symbol(d1, Decl(intersectionsAndEmptyObjects.ts, 30, 77)) >d2 : Symbol(d2, Decl(intersectionsAndEmptyObjects.ts, 31, 9)) diff --git a/tests/baselines/reference/intersectionsAndEmptyObjects.types b/tests/baselines/reference/intersectionsAndEmptyObjects.types index 6972e06169dcb..57864b2d289ea 100644 --- a/tests/baselines/reference/intersectionsAndEmptyObjects.types +++ b/tests/baselines/reference/intersectionsAndEmptyObjects.types @@ -75,10 +75,10 @@ const intersectDictionaries = ( >d2 : F2 ): F1 & F2 => Object.assign({}, d1, d2); ->Object.assign({}, d1, d2) : {} & F1 & F2 ->Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>Object.assign({}, d1, d2) : Writable & Writable +>Object.assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } >Object : ObjectConstructor ->assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } >{} : {} >d1 : F1 >d2 : F2 diff --git a/tests/baselines/reference/invalidTypeOfTarget.errors.txt b/tests/baselines/reference/invalidTypeOfTarget.errors.txt index db87a34095213..fa2d555560488 100644 --- a/tests/baselines/reference/invalidTypeOfTarget.errors.txt +++ b/tests/baselines/reference/invalidTypeOfTarget.errors.txt @@ -36,7 +36,7 @@ tests/cases/conformance/types/specifyingTypes/typeQueries/invalidTypeOfTarget.ts var x7: typeof function f() { }; ~~~~~~~~ !!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? -!!! related TS2728 /.ts/lib.es5.d.ts:318:13: 'Function' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:336:13: 'Function' is declared here. ~ !!! error TS1005: ',' expected. ~ diff --git a/tests/baselines/reference/javascriptDefinePropertyPrototypeNonConstructor.types b/tests/baselines/reference/javascriptDefinePropertyPrototypeNonConstructor.types index 7dbd38d69dffa..834380deb4edf 100644 --- a/tests/baselines/reference/javascriptDefinePropertyPrototypeNonConstructor.types +++ b/tests/baselines/reference/javascriptDefinePropertyPrototypeNonConstructor.types @@ -5,9 +5,9 @@ function Graphic() { Object.defineProperty(Graphic.prototype, "instance", { >Object.defineProperty(Graphic.prototype, "instance", { get: function() { return this; }}) : any ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Graphic.prototype : any >Graphic : typeof Graphic >prototype : any diff --git a/tests/baselines/reference/jsCheckObjectDefineThisNoCrash.types b/tests/baselines/reference/jsCheckObjectDefineThisNoCrash.types index e175b0527772f..00acd0d924652 100644 --- a/tests/baselines/reference/jsCheckObjectDefineThisNoCrash.types +++ b/tests/baselines/reference/jsCheckObjectDefineThisNoCrash.types @@ -6,9 +6,9 @@ class C { // Neither of the following should be recognized as declarations yet Object.defineProperty(this, "_prop", { value: {} }); >Object.defineProperty(this, "_prop", { value: {} }) : this ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >this : this >"_prop" : "_prop" >{ value: {} } : { value: {}; } @@ -17,9 +17,9 @@ class C { Object.defineProperty(this._prop, "num", { value: 12 }); >Object.defineProperty(this._prop, "num", { value: 12 }) : any ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >this._prop : any >this : this >_prop : any diff --git a/tests/baselines/reference/jsDeclarationsExportDefinePropertyEmit.types b/tests/baselines/reference/jsDeclarationsExportDefinePropertyEmit.types index fc664ec5d19a6..3bbfde8ecf84d 100644 --- a/tests/baselines/reference/jsDeclarationsExportDefinePropertyEmit.types +++ b/tests/baselines/reference/jsDeclarationsExportDefinePropertyEmit.types @@ -1,9 +1,9 @@ === tests/cases/conformance/jsdoc/declarations/index.js === Object.defineProperty(module.exports, "a", { value: function a() {} }); >Object.defineProperty(module.exports, "a", { value: function a() {} }) : typeof module.exports ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >module.exports : typeof module.exports >module : { exports: typeof module.exports; } >exports : typeof module.exports @@ -15,9 +15,9 @@ Object.defineProperty(module.exports, "a", { value: function a() {} }); Object.defineProperty(module.exports, "b", { value: function b() {} }); >Object.defineProperty(module.exports, "b", { value: function b() {} }) : typeof module.exports ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >module.exports : typeof module.exports >module : { exports: typeof module.exports; } >exports : typeof module.exports @@ -29,9 +29,9 @@ Object.defineProperty(module.exports, "b", { value: function b() {} }); Object.defineProperty(module.exports.b, "cat", { value: "cat" }); >Object.defineProperty(module.exports.b, "cat", { value: "cat" }) : () => void ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >module.exports.b : () => void >module.exports : typeof module.exports >module : { exports: typeof module.exports; } @@ -56,9 +56,9 @@ function d(a, b) { return /** @type {*} */(null); } Object.defineProperty(module.exports, "d", { value: d }); >Object.defineProperty(module.exports, "d", { value: d }) : typeof module.exports ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >module.exports : typeof module.exports >module : { exports: typeof module.exports; } >exports : typeof module.exports @@ -83,9 +83,9 @@ function e(a, b) { return /** @type {*} */(null); } Object.defineProperty(module.exports, "e", { value: e }); >Object.defineProperty(module.exports, "e", { value: e }) : typeof module.exports ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >module.exports : typeof module.exports >module : { exports: typeof module.exports; } >exports : typeof module.exports @@ -107,9 +107,9 @@ function f(a) { } Object.defineProperty(module.exports, "f", { value: f }); >Object.defineProperty(module.exports, "f", { value: f }) : typeof module.exports ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >module.exports : typeof module.exports >module : { exports: typeof module.exports; } >exports : typeof module.exports @@ -120,9 +120,9 @@ Object.defineProperty(module.exports, "f", { value: f }); Object.defineProperty(module.exports.f, "self", { value: module.exports.f }); >Object.defineProperty(module.exports.f, "self", { value: module.exports.f }) : (a: T) => T ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >module.exports.f : (a: T) => T >module.exports : typeof module.exports >module : { exports: typeof module.exports; } @@ -158,9 +158,9 @@ function g(a, b) { } Object.defineProperty(module.exports, "g", { value: g }); >Object.defineProperty(module.exports, "g", { value: g }) : typeof module.exports ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >module.exports : typeof module.exports >module : { exports: typeof module.exports; } >exports : typeof module.exports @@ -191,9 +191,9 @@ function hh(a, b) { } Object.defineProperty(module.exports, "h", { value: hh }); >Object.defineProperty(module.exports, "h", { value: hh }) : typeof module.exports ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >module.exports : typeof module.exports >module : { exports: typeof module.exports; } >exports : typeof module.exports @@ -204,9 +204,9 @@ Object.defineProperty(module.exports, "h", { value: hh }); Object.defineProperty(module.exports, "i", { value: function i(){} }); >Object.defineProperty(module.exports, "i", { value: function i(){} }) : typeof module.exports ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >module.exports : typeof module.exports >module : { exports: typeof module.exports; } >exports : typeof module.exports @@ -218,9 +218,9 @@ Object.defineProperty(module.exports, "i", { value: function i(){} }); Object.defineProperty(module.exports, "ii", { value: module.exports.i }); >Object.defineProperty(module.exports, "ii", { value: module.exports.i }) : typeof module.exports ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >module.exports : typeof module.exports >module : { exports: typeof module.exports; } >exports : typeof module.exports @@ -236,9 +236,9 @@ Object.defineProperty(module.exports, "ii", { value: module.exports.i }); // note that this last one doesn't make much sense in cjs, since exports aren't hoisted bindings Object.defineProperty(module.exports, "jj", { value: module.exports.j }); >Object.defineProperty(module.exports, "jj", { value: module.exports.j }) : typeof module.exports ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >module.exports : typeof module.exports >module : { exports: typeof module.exports; } >exports : typeof module.exports @@ -253,9 +253,9 @@ Object.defineProperty(module.exports, "jj", { value: module.exports.j }); Object.defineProperty(module.exports, "j", { value: function j() {} }); >Object.defineProperty(module.exports, "j", { value: function j() {} }) : typeof module.exports ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >module.exports : typeof module.exports >module : { exports: typeof module.exports; } >exports : typeof module.exports diff --git a/tests/baselines/reference/jsDeclarationsGetterSetter.types b/tests/baselines/reference/jsDeclarationsGetterSetter.types index 146600cc4151e..aa064fb2d5be8 100644 --- a/tests/baselines/reference/jsDeclarationsGetterSetter.types +++ b/tests/baselines/reference/jsDeclarationsGetterSetter.types @@ -42,9 +42,9 @@ export class D {} Object.defineProperty(D.prototype, "x", { >Object.defineProperty(D.prototype, "x", { get() { return 12; }}) : D ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >D.prototype : D >D : typeof D >prototype : D @@ -64,9 +64,9 @@ export class E {} Object.defineProperty(E.prototype, "x", { >Object.defineProperty(E.prototype, "x", { /** * @param {number} _arg */ set(_arg) {}}) : E ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >E.prototype : E >E : typeof E >prototype : E @@ -87,9 +87,9 @@ export class F {} Object.defineProperty(F.prototype, "x", { >Object.defineProperty(F.prototype, "x", { get() { return 12; }, /** * @param {number} _arg */ set(_arg) {}}) : F ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >F.prototype : F >F : typeof F >prototype : F diff --git a/tests/baselines/reference/jsExpandoObjectDefineProperty.types b/tests/baselines/reference/jsExpandoObjectDefineProperty.types index fb25ede2da462..d1c059915ea2e 100644 --- a/tests/baselines/reference/jsExpandoObjectDefineProperty.types +++ b/tests/baselines/reference/jsExpandoObjectDefineProperty.types @@ -5,9 +5,9 @@ var chrome = {} Object.defineProperty(chrome, 'devtools', { value: {}, enumerable: true }) >Object.defineProperty(chrome, 'devtools', { value: {}, enumerable: true }) : typeof chrome ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >chrome : typeof chrome >'devtools' : "devtools" >{ value: {}, enumerable: true } : { value: {}; enumerable: true; } diff --git a/tests/baselines/reference/jsFileESModuleWithEnumTag.types b/tests/baselines/reference/jsFileESModuleWithEnumTag.types index 4ecc2d0fdd6a5..57bf39e14d499 100644 --- a/tests/baselines/reference/jsFileESModuleWithEnumTag.types +++ b/tests/baselines/reference/jsFileESModuleWithEnumTag.types @@ -34,9 +34,9 @@ ChangeDetectionStrategy[ChangeDetectionStrategy.Default] = 'Default'; Object.defineProperty(ChangeDetectionStrategy, "aField", {value: 42}); >Object.defineProperty(ChangeDetectionStrategy, "aField", {value: 42}) : { OnPush: number; Default: number; } ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >ChangeDetectionStrategy : { OnPush: number; Default: number; } >"aField" : "aField" >{value: 42} : { value: number; } diff --git a/tests/baselines/reference/lateBoundAssignmentDeclarationSupport3.types b/tests/baselines/reference/lateBoundAssignmentDeclarationSupport3.types index 7f6c8d2c42ada..f04edbf31e6c5 100644 --- a/tests/baselines/reference/lateBoundAssignmentDeclarationSupport3.types +++ b/tests/baselines/reference/lateBoundAssignmentDeclarationSupport3.types @@ -32,9 +32,9 @@ const _str = "my-fake-sym"; Object.defineProperty(module.exports, _sym, { value: "ok" }); >Object.defineProperty(module.exports, _sym, { value: "ok" }) : typeof module.exports ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >module.exports : typeof module.exports >module : { exports: typeof module.exports; } >exports : typeof module.exports @@ -45,9 +45,9 @@ Object.defineProperty(module.exports, _sym, { value: "ok" }); Object.defineProperty(module.exports, _str, { value: "ok" }); >Object.defineProperty(module.exports, _str, { value: "ok" }) : typeof module.exports ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >module.exports : typeof module.exports >module : { exports: typeof module.exports; } >exports : typeof module.exports diff --git a/tests/baselines/reference/lateBoundAssignmentDeclarationSupport6.types b/tests/baselines/reference/lateBoundAssignmentDeclarationSupport6.types index 754ff5f67dbfe..fb697a9cfdc79 100644 --- a/tests/baselines/reference/lateBoundAssignmentDeclarationSupport6.types +++ b/tests/baselines/reference/lateBoundAssignmentDeclarationSupport6.types @@ -51,9 +51,9 @@ F.prototype.defsAClass = true; Object.defineProperty(F.prototype, _str, {value: "ok"}); >Object.defineProperty(F.prototype, _str, {value: "ok"}) : any ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >F.prototype : any >F : typeof F >prototype : any @@ -64,9 +64,9 @@ Object.defineProperty(F.prototype, _str, {value: "ok"}); Object.defineProperty(F.prototype, _sym, {value: "ok"}); >Object.defineProperty(F.prototype, _sym, {value: "ok"}) : any ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >F.prototype : any >F : typeof F >prototype : any diff --git a/tests/baselines/reference/mappedTypeWithAsClauseAndLateBoundProperty.errors.txt b/tests/baselines/reference/mappedTypeWithAsClauseAndLateBoundProperty.errors.txt index 5fb49e0dd99b6..9813122b70949 100644 --- a/tests/baselines/reference/mappedTypeWithAsClauseAndLateBoundProperty.errors.txt +++ b/tests/baselines/reference/mappedTypeWithAsClauseAndLateBoundProperty.errors.txt @@ -7,5 +7,5 @@ tests/cases/compiler/mappedTypeWithAsClauseAndLateBoundProperty.ts(3,1): error T tgt2 = src2; // Should error ~~~~ !!! error TS2741: Property 'length' is missing in type '{ [x: number]: number; toString: () => string; toLocaleString: () => string; pop: () => number; push: (...items: number[]) => number; concat: { (...items: ConcatArray[]): number[]; (...items: (number | ConcatArray)[]): number[]; }; join: (separator?: string) => string; reverse: () => number[]; shift: () => number; slice: (start?: number, end?: number) => number[]; sort: (compareFn?: (a: number, b: number) => number) => number[]; splice: { (start: number, deleteCount?: number): number[]; (start: number, deleteCount: number, ...items: number[]): number[]; }; unshift: (...items: number[]) => number; indexOf: (searchElement: number, fromIndex?: number) => number; lastIndexOf: (searchElement: number, fromIndex?: number) => number; every: { (predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): this is S[]; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): boolean; }; some: (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any) => boolean; forEach: (callbackfn: (value: number, index: number, array: number[]) => void, thisArg?: any) => void; map: (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[]; filter: { (predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): S[]; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): number[]; }; reduce: { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; }; reduceRight: { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; }; find: { (predicate: (this: void, value: number, index: number, obj: number[]) => value is S, thisArg?: any): S; (predicate: (value: number, index: number, obj: number[]) => unknown, thisArg?: any): number; }; findIndex: (predicate: (value: number, index: number, obj: number[]) => unknown, thisArg?: any) => number; fill: (value: number, start?: number, end?: number) => number[]; copyWithin: (target: number, start: number, end?: number) => number[]; entries: () => IterableIterator<[number, number]>; keys: () => IterableIterator; values: () => IterableIterator; includes: (searchElement: number, fromIndex?: number) => boolean; flatMap: (callback: (this: This, value: number, index: number, array: number[]) => U | readonly U[], thisArg?: This) => U[]; flat: (this: A, depth?: D) => FlatArray[]; [iterator]: () => IterableIterator; [unscopables]: () => { copyWithin: boolean; entries: boolean; fill: boolean; find: boolean; findIndex: boolean; keys: boolean; values: boolean; }; }' but required in type 'number[]'. -!!! related TS2728 /.ts/lib.es5.d.ts:1299:5: 'length' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1317:5: 'length' is declared here. \ No newline at end of file diff --git a/tests/baselines/reference/narrowExceptionVariableInCatchClause.errors.txt b/tests/baselines/reference/narrowExceptionVariableInCatchClause.errors.txt index 3a07bb2f5d9b6..47577ac5e36d0 100644 --- a/tests/baselines/reference/narrowExceptionVariableInCatchClause.errors.txt +++ b/tests/baselines/reference/narrowExceptionVariableInCatchClause.errors.txt @@ -24,7 +24,7 @@ tests/cases/conformance/types/any/narrowExceptionVariableInCatchClause.ts(16,17) err.massage; // ERROR: Property 'massage' does not exist on type 'Error' ~~~~~~~ !!! error TS2551: Property 'massage' does not exist on type 'Error'. Did you mean 'message'? -!!! related TS2728 /.ts/lib.es5.d.ts:1049:5: 'message' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1067:5: 'message' is declared here. } else { diff --git a/tests/baselines/reference/narrowFromAnyWithInstanceof.errors.txt b/tests/baselines/reference/narrowFromAnyWithInstanceof.errors.txt index 2206d1c9b214b..48f22bfde505d 100644 --- a/tests/baselines/reference/narrowFromAnyWithInstanceof.errors.txt +++ b/tests/baselines/reference/narrowFromAnyWithInstanceof.errors.txt @@ -22,7 +22,7 @@ tests/cases/conformance/types/any/narrowFromAnyWithInstanceof.ts(22,7): error TS x.mesage; ~~~~~~ !!! error TS2551: Property 'mesage' does not exist on type 'Error'. Did you mean 'message'? -!!! related TS2728 /.ts/lib.es5.d.ts:1049:5: 'message' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1067:5: 'message' is declared here. } if (x instanceof Date) { @@ -30,6 +30,6 @@ tests/cases/conformance/types/any/narrowFromAnyWithInstanceof.ts(22,7): error TS x.getHuors(); ~~~~~~~~ !!! error TS2551: Property 'getHuors' does not exist on type 'Date'. Did you mean 'getHours'? -!!! related TS2728 /.ts/lib.es5.d.ts:783:5: 'getHours' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:801:5: 'getHours' is declared here. } \ No newline at end of file diff --git a/tests/baselines/reference/narrowFromAnyWithTypePredicate.errors.txt b/tests/baselines/reference/narrowFromAnyWithTypePredicate.errors.txt index 109738a3f4bc8..d4ebdd0b74308 100644 --- a/tests/baselines/reference/narrowFromAnyWithTypePredicate.errors.txt +++ b/tests/baselines/reference/narrowFromAnyWithTypePredicate.errors.txt @@ -41,7 +41,7 @@ tests/cases/conformance/types/any/narrowFromAnyWithTypePredicate.ts(33,7): error x.mesage; ~~~~~~ !!! error TS2551: Property 'mesage' does not exist on type 'Error'. Did you mean 'message'? -!!! related TS2728 /.ts/lib.es5.d.ts:1049:5: 'message' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1067:5: 'message' is declared here. } if (isDate(x)) { @@ -49,6 +49,6 @@ tests/cases/conformance/types/any/narrowFromAnyWithTypePredicate.ts(33,7): error x.getHuors(); ~~~~~~~~ !!! error TS2551: Property 'getHuors' does not exist on type 'Date'. Did you mean 'getHours'? -!!! related TS2728 /.ts/lib.es5.d.ts:783:5: 'getHours' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:801:5: 'getHours' is declared here. } \ No newline at end of file diff --git a/tests/baselines/reference/objectFromEntries.types b/tests/baselines/reference/objectFromEntries.types index 9812b4ae90c4b..a8921ba8418c4 100644 --- a/tests/baselines/reference/objectFromEntries.types +++ b/tests/baselines/reference/objectFromEntries.types @@ -1,10 +1,10 @@ === tests/cases/compiler/objectFromEntries.ts === const o = Object.fromEntries([['a', 1], ['b', 2], ['c', 3]]); ->o : { [k: string]: number; } ->Object.fromEntries([['a', 1], ['b', 2], ['c', 3]]) : { [k: string]: number; } ->Object.fromEntries : { (entries: Iterable): { [k: string]: T; }; (entries: Iterable): any; } +>o : { [k: string]: number; [k: number]: number; [k: symbol]: number; } +>Object.fromEntries([['a', 1], ['b', 2], ['c', 3]]) : { [k: string]: number; [k: number]: number; [k: symbol]: number; } +>Object.fromEntries : { (entries: Iterable): { [k: string]: T; [k: number]: T; [k: symbol]: T; }; (entries: Iterable): any; } >Object : ObjectConstructor ->fromEntries : { (entries: Iterable): { [k: string]: T; }; (entries: Iterable): any; } +>fromEntries : { (entries: Iterable): { [k: string]: T; [k: number]: T; [k: symbol]: T; }; (entries: Iterable): any; } >[['a', 1], ['b', 2], ['c', 3]] : [string, number][] >['a', 1] : [string, number] >'a' : "a" @@ -17,20 +17,20 @@ const o = Object.fromEntries([['a', 1], ['b', 2], ['c', 3]]); >3 : 3 const o2 = Object.fromEntries(new URLSearchParams()); ->o2 : { [k: string]: string; } ->Object.fromEntries(new URLSearchParams()) : { [k: string]: string; } ->Object.fromEntries : { (entries: Iterable): { [k: string]: T; }; (entries: Iterable): any; } +>o2 : { [k: string]: string; [k: number]: string; [k: symbol]: string; } +>Object.fromEntries(new URLSearchParams()) : { [k: string]: string; [k: number]: string; [k: symbol]: string; } +>Object.fromEntries : { (entries: Iterable): { [k: string]: T; [k: number]: T; [k: symbol]: T; }; (entries: Iterable): any; } >Object : ObjectConstructor ->fromEntries : { (entries: Iterable): { [k: string]: T; }; (entries: Iterable): any; } +>fromEntries : { (entries: Iterable): { [k: string]: T; [k: number]: T; [k: symbol]: T; }; (entries: Iterable): any; } >new URLSearchParams() : URLSearchParams >URLSearchParams : { new (init?: string | URLSearchParams | string[][] | Record): URLSearchParams; prototype: URLSearchParams; toString(): string; } const o3 = Object.fromEntries(new Map([[Symbol("key"), "value"]])); ->o3 : { [k: string]: string; } ->Object.fromEntries(new Map([[Symbol("key"), "value"]])) : { [k: string]: string; } ->Object.fromEntries : { (entries: Iterable): { [k: string]: T; }; (entries: Iterable): any; } +>o3 : { [k: string]: string; [k: number]: string; [k: symbol]: string; } +>Object.fromEntries(new Map([[Symbol("key"), "value"]])) : { [k: string]: string; [k: number]: string; [k: symbol]: string; } +>Object.fromEntries : { (entries: Iterable): { [k: string]: T; [k: number]: T; [k: symbol]: T; }; (entries: Iterable): any; } >Object : ObjectConstructor ->fromEntries : { (entries: Iterable): { [k: string]: T; }; (entries: Iterable): any; } +>fromEntries : { (entries: Iterable): { [k: string]: T; [k: number]: T; [k: symbol]: T; }; (entries: Iterable): any; } >new Map([[Symbol("key"), "value"]]) : Map >Map : MapConstructor >[[Symbol("key"), "value"]] : [symbol, string][] @@ -60,9 +60,9 @@ const frozenArray = Object.freeze([['a', 1], ['b', 2], ['c', 3]]); const o4 = Object.fromEntries(frozenArray); >o4 : any >Object.fromEntries(frozenArray) : any ->Object.fromEntries : { (entries: Iterable): { [k: string]: T; }; (entries: Iterable): any; } +>Object.fromEntries : { (entries: Iterable): { [k: string]: T; [k: number]: T; [k: symbol]: T; }; (entries: Iterable): any; } >Object : ObjectConstructor ->fromEntries : { (entries: Iterable): { [k: string]: T; }; (entries: Iterable): any; } +>fromEntries : { (entries: Iterable): { [k: string]: T; [k: number]: T; [k: symbol]: T; }; (entries: Iterable): any; } >frozenArray : readonly (string | number)[][] const frozenArray2: readonly [string, number][] = Object.freeze([['a', 1], ['b', 2], ['c', 3]]); @@ -83,10 +83,10 @@ const frozenArray2: readonly [string, number][] = Object.freeze([['a', 1], ['b', >3 : 3 const o5 = Object.fromEntries(frozenArray2); ->o5 : { [k: string]: number; } ->Object.fromEntries(frozenArray2) : { [k: string]: number; } ->Object.fromEntries : { (entries: Iterable): { [k: string]: T; }; (entries: Iterable): any; } +>o5 : { [k: string]: number; [k: number]: number; [k: symbol]: number; } +>Object.fromEntries(frozenArray2) : { [k: string]: number; [k: number]: number; [k: symbol]: number; } +>Object.fromEntries : { (entries: Iterable): { [k: string]: T; [k: number]: T; [k: symbol]: T; }; (entries: Iterable): any; } >Object : ObjectConstructor ->fromEntries : { (entries: Iterable): { [k: string]: T; }; (entries: Iterable): any; } +>fromEntries : { (entries: Iterable): { [k: string]: T; [k: number]: T; [k: symbol]: T; }; (entries: Iterable): any; } >frozenArray2 : readonly [string, number][] diff --git a/tests/baselines/reference/objectLitGetterSetter.types b/tests/baselines/reference/objectLitGetterSetter.types index 54c587890f8ac..f70bb3d8a3c9f 100644 --- a/tests/baselines/reference/objectLitGetterSetter.types +++ b/tests/baselines/reference/objectLitGetterSetter.types @@ -5,9 +5,9 @@ Object.defineProperty(obj, "accProperty", ({ >Object.defineProperty(obj, "accProperty", ({ get: function () { eval("public = 1;"); return 11; }, set: function (v) { } })) : {} ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >obj : {} >"accProperty" : "accProperty" >({ get: function () { eval("public = 1;"); return 11; }, set: function (v) { } }) : PropertyDescriptor diff --git a/tests/baselines/reference/objectMethodNullability.errors.txt b/tests/baselines/reference/objectMethodNullability.errors.txt new file mode 100644 index 0000000000000..570b7e758ea56 --- /dev/null +++ b/tests/baselines/reference/objectMethodNullability.errors.txt @@ -0,0 +1,135 @@ +tests/cases/compiler/objectMethodNullability.ts(3,15): error TS2769: No overload matches this call. + Overload 1 of 5, '(target: {}): {}', gave the following error. + Argument of type 'undefined' is not assignable to parameter of type '{}'. + Overload 2 of 5, '(target: {}, ...sources: any[]): any', gave the following error. + Argument of type 'undefined' is not assignable to parameter of type '{}'. +tests/cases/compiler/objectMethodNullability.ts(4,15): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'object | null'. +tests/cases/compiler/objectMethodNullability.ts(5,25): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'object'. +tests/cases/compiler/objectMethodNullability.ts(6,23): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'object'. +tests/cases/compiler/objectMethodNullability.ts(7,16): error TS2769: No overload matches this call. + Overload 1 of 2, '(o: { [s: string]: unknown; } | ArrayLike): [string, unknown][]', gave the following error. + Argument of type 'undefined' is not assignable to parameter of type '{ [s: string]: unknown; } | ArrayLike'. + Overload 2 of 2, '(o: {}): [string, any][]', gave the following error. + Argument of type 'undefined' is not assignable to parameter of type '{}'. +tests/cases/compiler/objectMethodNullability.ts(8,33): error TS2345: Argument of type 'undefined' is not assignable to parameter of type '{}'. +tests/cases/compiler/objectMethodNullability.ts(9,34): error TS2345: Argument of type 'undefined' is not assignable to parameter of type '{}'. +tests/cases/compiler/objectMethodNullability.ts(10,28): error TS2345: Argument of type 'undefined' is not assignable to parameter of type '{}'. +tests/cases/compiler/objectMethodNullability.ts(11,30): error TS2345: Argument of type 'undefined' is not assignable to parameter of type '{}'. +tests/cases/compiler/objectMethodNullability.ts(12,23): error TS2345: Argument of type 'undefined' is not assignable to parameter of type '{}'. +tests/cases/compiler/objectMethodNullability.ts(13,15): error TS2345: Argument of type 'undefined' is not assignable to parameter of type '{}'. +tests/cases/compiler/objectMethodNullability.ts(14,13): error TS2769: No overload matches this call. + Overload 1 of 2, '(o: {}): string[]', gave the following error. + Argument of type 'undefined' is not assignable to parameter of type '{}'. + Overload 2 of 2, '(o: object): string[]', gave the following error. + Argument of type 'undefined' is not assignable to parameter of type 'object'. +tests/cases/compiler/objectMethodNullability.ts(15,23): error TS2345: Argument of type 'undefined' is not assignable to parameter of type '{}'. +tests/cases/compiler/objectMethodNullability.ts(16,15): error TS2769: No overload matches this call. + Overload 1 of 2, '(o: ArrayLike | { [s: string]: unknown; }): unknown[]', gave the following error. + Argument of type 'undefined' is not assignable to parameter of type 'ArrayLike | { [s: string]: unknown; }'. + Overload 2 of 2, '(o: {}): any[]', gave the following error. + Argument of type 'undefined' is not assignable to parameter of type '{}'. +tests/cases/compiler/objectMethodNullability.ts(18,15): error TS2345: Argument of type 'number' is not assignable to parameter of type 'object'. +tests/cases/compiler/objectMethodNullability.ts(19,25): error TS2345: Argument of type 'number' is not assignable to parameter of type 'object'. +tests/cases/compiler/objectMethodNullability.ts(20,23): error TS2345: Argument of type 'number' is not assignable to parameter of type 'object'. + + +==== tests/cases/compiler/objectMethodNullability.ts (17 errors) ==== + // All of the following should produce an error: + + Object.assign(undefined); + ~~~~~~~~~ +!!! error TS2769: No overload matches this call. +!!! error TS2769: Overload 1 of 5, '(target: {}): {}', gave the following error. +!!! error TS2769: Argument of type 'undefined' is not assignable to parameter of type '{}'. +!!! error TS2769: Overload 2 of 5, '(target: {}, ...sources: any[]): any', gave the following error. +!!! error TS2769: Argument of type 'undefined' is not assignable to parameter of type '{}'. + Object.create(undefined); + ~~~~~~~~~ +!!! error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'object | null'. + Object.defineProperties(undefined, {}); + ~~~~~~~~~ +!!! error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'object'. + Object.defineProperty(undefined, "foo", {}); + ~~~~~~~~~ +!!! error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'object'. + Object.entries(undefined); + ~~~~~~~~~ +!!! error TS2769: No overload matches this call. +!!! error TS2769: Overload 1 of 2, '(o: { [s: string]: unknown; } | ArrayLike): [string, unknown][]', gave the following error. +!!! error TS2769: Argument of type 'undefined' is not assignable to parameter of type '{ [s: string]: unknown; } | ArrayLike'. +!!! error TS2769: Overload 2 of 2, '(o: {}): [string, any][]', gave the following error. +!!! error TS2769: Argument of type 'undefined' is not assignable to parameter of type '{}'. + Object.getOwnPropertyDescriptor(undefined, "foo"); + ~~~~~~~~~ +!!! error TS2345: Argument of type 'undefined' is not assignable to parameter of type '{}'. + Object.getOwnPropertyDescriptors(undefined); + ~~~~~~~~~ +!!! error TS2345: Argument of type 'undefined' is not assignable to parameter of type '{}'. + Object.getOwnPropertyNames(undefined); + ~~~~~~~~~ +!!! error TS2345: Argument of type 'undefined' is not assignable to parameter of type '{}'. + Object.getOwnPropertySymbols(undefined); + ~~~~~~~~~ +!!! error TS2345: Argument of type 'undefined' is not assignable to parameter of type '{}'. + Object.getPrototypeOf(undefined); + ~~~~~~~~~ +!!! error TS2345: Argument of type 'undefined' is not assignable to parameter of type '{}'. + Object.hasOwn(undefined, "foo"); + ~~~~~~~~~ +!!! error TS2345: Argument of type 'undefined' is not assignable to parameter of type '{}'. + Object.keys(undefined); + ~~~~~~~~~ +!!! error TS2769: No overload matches this call. +!!! error TS2769: Overload 1 of 2, '(o: {}): string[]', gave the following error. +!!! error TS2769: Argument of type 'undefined' is not assignable to parameter of type '{}'. +!!! error TS2769: Overload 2 of 2, '(o: object): string[]', gave the following error. +!!! error TS2769: Argument of type 'undefined' is not assignable to parameter of type 'object'. + Object.setPrototypeOf(undefined, {}); + ~~~~~~~~~ +!!! error TS2345: Argument of type 'undefined' is not assignable to parameter of type '{}'. + Object.values(undefined); + ~~~~~~~~~ +!!! error TS2769: No overload matches this call. +!!! error TS2769: Overload 1 of 2, '(o: ArrayLike | { [s: string]: unknown; }): unknown[]', gave the following error. +!!! error TS2769: Argument of type 'undefined' is not assignable to parameter of type 'ArrayLike | { [s: string]: unknown; }'. +!!! error TS2769: Overload 2 of 2, '(o: {}): any[]', gave the following error. +!!! error TS2769: Argument of type 'undefined' is not assignable to parameter of type '{}'. + + Object.create(0); + ~ +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'object'. + Object.defineProperties(0, {}); + ~ +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'object'. + Object.defineProperty(0, "foo", {}); + ~ +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'object'. + + // While the following should not: + + Object.assign(0); + Object.entries(0); + Object.getOwnPropertyDescriptor(0, "foo"); + Object.getOwnPropertyDescriptors(0); + Object.getOwnPropertyNames(0); + Object.getOwnPropertySymbols(0); + Object.getPrototypeOf(0); + Object.hasOwn(0, "foo"); + Object.keys(0); + Object.setPrototypeOf(0, {}); + Object.values(0); + + Object.freeze(undefined); + Object.isExtensible(undefined); + Object.isFrozen(undefined); + Object.isSealed(undefined); + Object.preventExtensions(undefined); + Object.seal(undefined); + + Object.freeze(0); + Object.isExtensible(0); + Object.isFrozen(0); + Object.isSealed(0); + Object.preventExtensions(0); + Object.seal(0); + \ No newline at end of file diff --git a/tests/baselines/reference/objectMethodNullability.js b/tests/baselines/reference/objectMethodNullability.js new file mode 100644 index 0000000000000..0fbc2117922b2 --- /dev/null +++ b/tests/baselines/reference/objectMethodNullability.js @@ -0,0 +1,95 @@ +//// [objectMethodNullability.ts] +// All of the following should produce an error: + +Object.assign(undefined); +Object.create(undefined); +Object.defineProperties(undefined, {}); +Object.defineProperty(undefined, "foo", {}); +Object.entries(undefined); +Object.getOwnPropertyDescriptor(undefined, "foo"); +Object.getOwnPropertyDescriptors(undefined); +Object.getOwnPropertyNames(undefined); +Object.getOwnPropertySymbols(undefined); +Object.getPrototypeOf(undefined); +Object.hasOwn(undefined, "foo"); +Object.keys(undefined); +Object.setPrototypeOf(undefined, {}); +Object.values(undefined); + +Object.create(0); +Object.defineProperties(0, {}); +Object.defineProperty(0, "foo", {}); + +// While the following should not: + +Object.assign(0); +Object.entries(0); +Object.getOwnPropertyDescriptor(0, "foo"); +Object.getOwnPropertyDescriptors(0); +Object.getOwnPropertyNames(0); +Object.getOwnPropertySymbols(0); +Object.getPrototypeOf(0); +Object.hasOwn(0, "foo"); +Object.keys(0); +Object.setPrototypeOf(0, {}); +Object.values(0); + +Object.freeze(undefined); +Object.isExtensible(undefined); +Object.isFrozen(undefined); +Object.isSealed(undefined); +Object.preventExtensions(undefined); +Object.seal(undefined); + +Object.freeze(0); +Object.isExtensible(0); +Object.isFrozen(0); +Object.isSealed(0); +Object.preventExtensions(0); +Object.seal(0); + + +//// [objectMethodNullability.js] +"use strict"; +// All of the following should produce an error: +Object.assign(undefined); +Object.create(undefined); +Object.defineProperties(undefined, {}); +Object.defineProperty(undefined, "foo", {}); +Object.entries(undefined); +Object.getOwnPropertyDescriptor(undefined, "foo"); +Object.getOwnPropertyDescriptors(undefined); +Object.getOwnPropertyNames(undefined); +Object.getOwnPropertySymbols(undefined); +Object.getPrototypeOf(undefined); +Object.hasOwn(undefined, "foo"); +Object.keys(undefined); +Object.setPrototypeOf(undefined, {}); +Object.values(undefined); +Object.create(0); +Object.defineProperties(0, {}); +Object.defineProperty(0, "foo", {}); +// While the following should not: +Object.assign(0); +Object.entries(0); +Object.getOwnPropertyDescriptor(0, "foo"); +Object.getOwnPropertyDescriptors(0); +Object.getOwnPropertyNames(0); +Object.getOwnPropertySymbols(0); +Object.getPrototypeOf(0); +Object.hasOwn(0, "foo"); +Object.keys(0); +Object.setPrototypeOf(0, {}); +Object.values(0); +Object.freeze(undefined); +Object.isExtensible(undefined); +Object.isFrozen(undefined); +Object.isSealed(undefined); +Object.preventExtensions(undefined); +Object.seal(undefined); +Object.freeze(0); +Object.isExtensible(0); +Object.isFrozen(0); +Object.isSealed(0); +Object.preventExtensions(0); +Object.seal(0); diff --git a/tests/baselines/reference/objectMethodNullability.symbols b/tests/baselines/reference/objectMethodNullability.symbols new file mode 100644 index 0000000000000..ee25962e68871 --- /dev/null +++ b/tests/baselines/reference/objectMethodNullability.symbols @@ -0,0 +1,225 @@ +=== tests/cases/compiler/objectMethodNullability.ts === +// All of the following should produce an error: + +Object.assign(undefined); +>Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>undefined : Symbol(undefined) + +Object.create(undefined); +>Object.create : Symbol(ObjectConstructor.create, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>create : Symbol(ObjectConstructor.create, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>undefined : Symbol(undefined) + +Object.defineProperties(undefined, {}); +>Object.defineProperties : Symbol(ObjectConstructor.defineProperties, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>defineProperties : Symbol(ObjectConstructor.defineProperties, Decl(lib.es5.d.ts, --, --)) +>undefined : Symbol(undefined) + +Object.defineProperty(undefined, "foo", {}); +>Object.defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) +>undefined : Symbol(undefined) + +Object.entries(undefined); +>Object.entries : Symbol(ObjectConstructor.entries, Decl(lib.es2017.object.d.ts, --, --), Decl(lib.es2017.object.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>entries : Symbol(ObjectConstructor.entries, Decl(lib.es2017.object.d.ts, --, --), Decl(lib.es2017.object.d.ts, --, --)) +>undefined : Symbol(undefined) + +Object.getOwnPropertyDescriptor(undefined, "foo"); +>Object.getOwnPropertyDescriptor : Symbol(ObjectConstructor.getOwnPropertyDescriptor, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>getOwnPropertyDescriptor : Symbol(ObjectConstructor.getOwnPropertyDescriptor, Decl(lib.es5.d.ts, --, --)) +>undefined : Symbol(undefined) + +Object.getOwnPropertyDescriptors(undefined); +>Object.getOwnPropertyDescriptors : Symbol(ObjectConstructor.getOwnPropertyDescriptors, Decl(lib.es2017.object.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>getOwnPropertyDescriptors : Symbol(ObjectConstructor.getOwnPropertyDescriptors, Decl(lib.es2017.object.d.ts, --, --)) +>undefined : Symbol(undefined) + +Object.getOwnPropertyNames(undefined); +>Object.getOwnPropertyNames : Symbol(ObjectConstructor.getOwnPropertyNames, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>getOwnPropertyNames : Symbol(ObjectConstructor.getOwnPropertyNames, Decl(lib.es5.d.ts, --, --)) +>undefined : Symbol(undefined) + +Object.getOwnPropertySymbols(undefined); +>Object.getOwnPropertySymbols : Symbol(ObjectConstructor.getOwnPropertySymbols, Decl(lib.es2015.core.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>getOwnPropertySymbols : Symbol(ObjectConstructor.getOwnPropertySymbols, Decl(lib.es2015.core.d.ts, --, --)) +>undefined : Symbol(undefined) + +Object.getPrototypeOf(undefined); +>Object.getPrototypeOf : Symbol(ObjectConstructor.getPrototypeOf, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>getPrototypeOf : Symbol(ObjectConstructor.getPrototypeOf, Decl(lib.es5.d.ts, --, --)) +>undefined : Symbol(undefined) + +Object.hasOwn(undefined, "foo"); +>Object.hasOwn : Symbol(ObjectConstructor.hasOwn, Decl(lib.es2022.object.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>hasOwn : Symbol(ObjectConstructor.hasOwn, Decl(lib.es2022.object.d.ts, --, --)) +>undefined : Symbol(undefined) + +Object.keys(undefined); +>Object.keys : Symbol(ObjectConstructor.keys, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>keys : Symbol(ObjectConstructor.keys, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>undefined : Symbol(undefined) + +Object.setPrototypeOf(undefined, {}); +>Object.setPrototypeOf : Symbol(ObjectConstructor.setPrototypeOf, Decl(lib.es2015.core.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>setPrototypeOf : Symbol(ObjectConstructor.setPrototypeOf, Decl(lib.es2015.core.d.ts, --, --)) +>undefined : Symbol(undefined) + +Object.values(undefined); +>Object.values : Symbol(ObjectConstructor.values, Decl(lib.es2017.object.d.ts, --, --), Decl(lib.es2017.object.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>values : Symbol(ObjectConstructor.values, Decl(lib.es2017.object.d.ts, --, --), Decl(lib.es2017.object.d.ts, --, --)) +>undefined : Symbol(undefined) + +Object.create(0); +>Object.create : Symbol(ObjectConstructor.create, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>create : Symbol(ObjectConstructor.create, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + +Object.defineProperties(0, {}); +>Object.defineProperties : Symbol(ObjectConstructor.defineProperties, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>defineProperties : Symbol(ObjectConstructor.defineProperties, Decl(lib.es5.d.ts, --, --)) + +Object.defineProperty(0, "foo", {}); +>Object.defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) + +// While the following should not: + +Object.assign(0); +>Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) + +Object.entries(0); +>Object.entries : Symbol(ObjectConstructor.entries, Decl(lib.es2017.object.d.ts, --, --), Decl(lib.es2017.object.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>entries : Symbol(ObjectConstructor.entries, Decl(lib.es2017.object.d.ts, --, --), Decl(lib.es2017.object.d.ts, --, --)) + +Object.getOwnPropertyDescriptor(0, "foo"); +>Object.getOwnPropertyDescriptor : Symbol(ObjectConstructor.getOwnPropertyDescriptor, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>getOwnPropertyDescriptor : Symbol(ObjectConstructor.getOwnPropertyDescriptor, Decl(lib.es5.d.ts, --, --)) + +Object.getOwnPropertyDescriptors(0); +>Object.getOwnPropertyDescriptors : Symbol(ObjectConstructor.getOwnPropertyDescriptors, Decl(lib.es2017.object.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>getOwnPropertyDescriptors : Symbol(ObjectConstructor.getOwnPropertyDescriptors, Decl(lib.es2017.object.d.ts, --, --)) + +Object.getOwnPropertyNames(0); +>Object.getOwnPropertyNames : Symbol(ObjectConstructor.getOwnPropertyNames, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>getOwnPropertyNames : Symbol(ObjectConstructor.getOwnPropertyNames, Decl(lib.es5.d.ts, --, --)) + +Object.getOwnPropertySymbols(0); +>Object.getOwnPropertySymbols : Symbol(ObjectConstructor.getOwnPropertySymbols, Decl(lib.es2015.core.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>getOwnPropertySymbols : Symbol(ObjectConstructor.getOwnPropertySymbols, Decl(lib.es2015.core.d.ts, --, --)) + +Object.getPrototypeOf(0); +>Object.getPrototypeOf : Symbol(ObjectConstructor.getPrototypeOf, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>getPrototypeOf : Symbol(ObjectConstructor.getPrototypeOf, Decl(lib.es5.d.ts, --, --)) + +Object.hasOwn(0, "foo"); +>Object.hasOwn : Symbol(ObjectConstructor.hasOwn, Decl(lib.es2022.object.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>hasOwn : Symbol(ObjectConstructor.hasOwn, Decl(lib.es2022.object.d.ts, --, --)) + +Object.keys(0); +>Object.keys : Symbol(ObjectConstructor.keys, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>keys : Symbol(ObjectConstructor.keys, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) + +Object.setPrototypeOf(0, {}); +>Object.setPrototypeOf : Symbol(ObjectConstructor.setPrototypeOf, Decl(lib.es2015.core.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>setPrototypeOf : Symbol(ObjectConstructor.setPrototypeOf, Decl(lib.es2015.core.d.ts, --, --)) + +Object.values(0); +>Object.values : Symbol(ObjectConstructor.values, Decl(lib.es2017.object.d.ts, --, --), Decl(lib.es2017.object.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>values : Symbol(ObjectConstructor.values, Decl(lib.es2017.object.d.ts, --, --), Decl(lib.es2017.object.d.ts, --, --)) + +Object.freeze(undefined); +>Object.freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>undefined : Symbol(undefined) + +Object.isExtensible(undefined); +>Object.isExtensible : Symbol(ObjectConstructor.isExtensible, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>isExtensible : Symbol(ObjectConstructor.isExtensible, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>undefined : Symbol(undefined) + +Object.isFrozen(undefined); +>Object.isFrozen : Symbol(ObjectConstructor.isFrozen, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>isFrozen : Symbol(ObjectConstructor.isFrozen, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>undefined : Symbol(undefined) + +Object.isSealed(undefined); +>Object.isSealed : Symbol(ObjectConstructor.isSealed, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>isSealed : Symbol(ObjectConstructor.isSealed, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>undefined : Symbol(undefined) + +Object.preventExtensions(undefined); +>Object.preventExtensions : Symbol(ObjectConstructor.preventExtensions, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>preventExtensions : Symbol(ObjectConstructor.preventExtensions, Decl(lib.es5.d.ts, --, --)) +>undefined : Symbol(undefined) + +Object.seal(undefined); +>Object.seal : Symbol(ObjectConstructor.seal, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>seal : Symbol(ObjectConstructor.seal, Decl(lib.es5.d.ts, --, --)) +>undefined : Symbol(undefined) + +Object.freeze(0); +>Object.freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + +Object.isExtensible(0); +>Object.isExtensible : Symbol(ObjectConstructor.isExtensible, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>isExtensible : Symbol(ObjectConstructor.isExtensible, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + +Object.isFrozen(0); +>Object.isFrozen : Symbol(ObjectConstructor.isFrozen, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>isFrozen : Symbol(ObjectConstructor.isFrozen, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + +Object.isSealed(0); +>Object.isSealed : Symbol(ObjectConstructor.isSealed, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>isSealed : Symbol(ObjectConstructor.isSealed, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + +Object.preventExtensions(0); +>Object.preventExtensions : Symbol(ObjectConstructor.preventExtensions, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>preventExtensions : Symbol(ObjectConstructor.preventExtensions, Decl(lib.es5.d.ts, --, --)) + +Object.seal(0); +>Object.seal : Symbol(ObjectConstructor.seal, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>seal : Symbol(ObjectConstructor.seal, Decl(lib.es5.d.ts, --, --)) + diff --git a/tests/baselines/reference/objectMethodNullability.types b/tests/baselines/reference/objectMethodNullability.types new file mode 100644 index 0000000000000..8a9d71816061b --- /dev/null +++ b/tests/baselines/reference/objectMethodNullability.types @@ -0,0 +1,297 @@ +=== tests/cases/compiler/objectMethodNullability.ts === +// All of the following should produce an error: + +Object.assign(undefined); +>Object.assign(undefined) : {} +>Object.assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } +>Object : ObjectConstructor +>assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } +>undefined : undefined + +Object.create(undefined); +>Object.create(undefined) : any +>Object.create : { (o: object | null): any; (o: object | null, properties: PropertyDescriptorMap & ThisType): any; } +>Object : ObjectConstructor +>create : { (o: object | null): any; (o: object | null, properties: PropertyDescriptorMap & ThisType): any; } +>undefined : undefined + +Object.defineProperties(undefined, {}); +>Object.defineProperties(undefined, {}) : object +>Object.defineProperties : (o: T, properties: PropertyDescriptorMap & ThisType) => T +>Object : ObjectConstructor +>defineProperties : (o: T, properties: PropertyDescriptorMap & ThisType) => T +>undefined : undefined +>{} : {} + +Object.defineProperty(undefined, "foo", {}); +>Object.defineProperty(undefined, "foo", {}) : object +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object : ObjectConstructor +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>undefined : undefined +>"foo" : "foo" +>{} : {} + +Object.entries(undefined); +>Object.entries(undefined) : [string, unknown][] +>Object.entries : { (o: { [s: string]: T; } | ArrayLike): [string, T][]; (o: {}): [string, any][]; } +>Object : ObjectConstructor +>entries : { (o: { [s: string]: T; } | ArrayLike): [string, T][]; (o: {}): [string, any][]; } +>undefined : undefined + +Object.getOwnPropertyDescriptor(undefined, "foo"); +>Object.getOwnPropertyDescriptor(undefined, "foo") : PropertyDescriptor | undefined +>Object.getOwnPropertyDescriptor : (o: {}, p: PropertyKey) => PropertyDescriptor | undefined +>Object : ObjectConstructor +>getOwnPropertyDescriptor : (o: {}, p: PropertyKey) => PropertyDescriptor | undefined +>undefined : undefined +>"foo" : "foo" + +Object.getOwnPropertyDescriptors(undefined); +>Object.getOwnPropertyDescriptors(undefined) : {} & PropertyDescriptorMap +>Object.getOwnPropertyDescriptors : (o: T) => { [P in keyof T]: TypedPropertyDescriptor; } & PropertyDescriptorMap +>Object : ObjectConstructor +>getOwnPropertyDescriptors : (o: T) => { [P in keyof T]: TypedPropertyDescriptor; } & PropertyDescriptorMap +>undefined : undefined + +Object.getOwnPropertyNames(undefined); +>Object.getOwnPropertyNames(undefined) : string[] +>Object.getOwnPropertyNames : (o: {}) => string[] +>Object : ObjectConstructor +>getOwnPropertyNames : (o: {}) => string[] +>undefined : undefined + +Object.getOwnPropertySymbols(undefined); +>Object.getOwnPropertySymbols(undefined) : symbol[] +>Object.getOwnPropertySymbols : (o: {}) => symbol[] +>Object : ObjectConstructor +>getOwnPropertySymbols : (o: {}) => symbol[] +>undefined : undefined + +Object.getPrototypeOf(undefined); +>Object.getPrototypeOf(undefined) : any +>Object.getPrototypeOf : (o: {}) => any +>Object : ObjectConstructor +>getPrototypeOf : (o: {}) => any +>undefined : undefined + +Object.hasOwn(undefined, "foo"); +>Object.hasOwn(undefined, "foo") : boolean +>Object.hasOwn : (o: {}, v: PropertyKey) => boolean +>Object : ObjectConstructor +>hasOwn : (o: {}, v: PropertyKey) => boolean +>undefined : undefined +>"foo" : "foo" + +Object.keys(undefined); +>Object.keys(undefined) : string[] +>Object.keys : { (o: object): string[]; (o: {}): string[]; } +>Object : ObjectConstructor +>keys : { (o: object): string[]; (o: {}): string[]; } +>undefined : undefined + +Object.setPrototypeOf(undefined, {}); +>Object.setPrototypeOf(undefined, {}) : any +>Object.setPrototypeOf : (o: {}, proto: object | null) => any +>Object : ObjectConstructor +>setPrototypeOf : (o: {}, proto: object | null) => any +>undefined : undefined +>{} : {} + +Object.values(undefined); +>Object.values(undefined) : unknown[] +>Object.values : { (o: { [s: string]: T; } | ArrayLike): T[]; (o: {}): any[]; } +>Object : ObjectConstructor +>values : { (o: { [s: string]: T; } | ArrayLike): T[]; (o: {}): any[]; } +>undefined : undefined + +Object.create(0); +>Object.create(0) : any +>Object.create : { (o: object | null): any; (o: object | null, properties: PropertyDescriptorMap & ThisType): any; } +>Object : ObjectConstructor +>create : { (o: object | null): any; (o: object | null, properties: PropertyDescriptorMap & ThisType): any; } +>0 : 0 + +Object.defineProperties(0, {}); +>Object.defineProperties(0, {}) : object +>Object.defineProperties : (o: T, properties: PropertyDescriptorMap & ThisType) => T +>Object : ObjectConstructor +>defineProperties : (o: T, properties: PropertyDescriptorMap & ThisType) => T +>0 : 0 +>{} : {} + +Object.defineProperty(0, "foo", {}); +>Object.defineProperty(0, "foo", {}) : object +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object : ObjectConstructor +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>0 : 0 +>"foo" : "foo" +>{} : {} + +// While the following should not: + +Object.assign(0); +>Object.assign(0) : 0 +>Object.assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } +>Object : ObjectConstructor +>assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } +>0 : 0 + +Object.entries(0); +>Object.entries(0) : [string, any][] +>Object.entries : { (o: { [s: string]: T; } | ArrayLike): [string, T][]; (o: {}): [string, any][]; } +>Object : ObjectConstructor +>entries : { (o: { [s: string]: T; } | ArrayLike): [string, T][]; (o: {}): [string, any][]; } +>0 : 0 + +Object.getOwnPropertyDescriptor(0, "foo"); +>Object.getOwnPropertyDescriptor(0, "foo") : PropertyDescriptor | undefined +>Object.getOwnPropertyDescriptor : (o: {}, p: PropertyKey) => PropertyDescriptor | undefined +>Object : ObjectConstructor +>getOwnPropertyDescriptor : (o: {}, p: PropertyKey) => PropertyDescriptor | undefined +>0 : 0 +>"foo" : "foo" + +Object.getOwnPropertyDescriptors(0); +>Object.getOwnPropertyDescriptors(0) : number & PropertyDescriptorMap +>Object.getOwnPropertyDescriptors : (o: T) => { [P in keyof T]: TypedPropertyDescriptor; } & PropertyDescriptorMap +>Object : ObjectConstructor +>getOwnPropertyDescriptors : (o: T) => { [P in keyof T]: TypedPropertyDescriptor; } & PropertyDescriptorMap +>0 : 0 + +Object.getOwnPropertyNames(0); +>Object.getOwnPropertyNames(0) : string[] +>Object.getOwnPropertyNames : (o: {}) => string[] +>Object : ObjectConstructor +>getOwnPropertyNames : (o: {}) => string[] +>0 : 0 + +Object.getOwnPropertySymbols(0); +>Object.getOwnPropertySymbols(0) : symbol[] +>Object.getOwnPropertySymbols : (o: {}) => symbol[] +>Object : ObjectConstructor +>getOwnPropertySymbols : (o: {}) => symbol[] +>0 : 0 + +Object.getPrototypeOf(0); +>Object.getPrototypeOf(0) : any +>Object.getPrototypeOf : (o: {}) => any +>Object : ObjectConstructor +>getPrototypeOf : (o: {}) => any +>0 : 0 + +Object.hasOwn(0, "foo"); +>Object.hasOwn(0, "foo") : boolean +>Object.hasOwn : (o: {}, v: PropertyKey) => boolean +>Object : ObjectConstructor +>hasOwn : (o: {}, v: PropertyKey) => boolean +>0 : 0 +>"foo" : "foo" + +Object.keys(0); +>Object.keys(0) : string[] +>Object.keys : { (o: object): string[]; (o: {}): string[]; } +>Object : ObjectConstructor +>keys : { (o: object): string[]; (o: {}): string[]; } +>0 : 0 + +Object.setPrototypeOf(0, {}); +>Object.setPrototypeOf(0, {}) : any +>Object.setPrototypeOf : (o: {}, proto: object | null) => any +>Object : ObjectConstructor +>setPrototypeOf : (o: {}, proto: object | null) => any +>0 : 0 +>{} : {} + +Object.values(0); +>Object.values(0) : any[] +>Object.values : { (o: { [s: string]: T; } | ArrayLike): T[]; (o: {}): any[]; } +>Object : ObjectConstructor +>values : { (o: { [s: string]: T; } | ArrayLike): T[]; (o: {}): any[]; } +>0 : 0 + +Object.freeze(undefined); +>Object.freeze(undefined) : undefined +>Object.freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>Object : ObjectConstructor +>freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>undefined : undefined + +Object.isExtensible(undefined); +>Object.isExtensible(undefined) : false +>Object.isExtensible : { (o: object): boolean; (o: any): false; } +>Object : ObjectConstructor +>isExtensible : { (o: object): boolean; (o: any): false; } +>undefined : undefined + +Object.isFrozen(undefined); +>Object.isFrozen(undefined) : true +>Object.isFrozen : { (o: object): boolean; (o: any): true; } +>Object : ObjectConstructor +>isFrozen : { (o: object): boolean; (o: any): true; } +>undefined : undefined + +Object.isSealed(undefined); +>Object.isSealed(undefined) : true +>Object.isSealed : { (o: object): boolean; (o: any): true; } +>Object : ObjectConstructor +>isSealed : { (o: object): boolean; (o: any): true; } +>undefined : undefined + +Object.preventExtensions(undefined); +>Object.preventExtensions(undefined) : undefined +>Object.preventExtensions : (o: T) => T +>Object : ObjectConstructor +>preventExtensions : (o: T) => T +>undefined : undefined + +Object.seal(undefined); +>Object.seal(undefined) : undefined +>Object.seal : (o: T) => T +>Object : ObjectConstructor +>seal : (o: T) => T +>undefined : undefined + +Object.freeze(0); +>Object.freeze(0) : number +>Object.freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>Object : ObjectConstructor +>freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>0 : 0 + +Object.isExtensible(0); +>Object.isExtensible(0) : false +>Object.isExtensible : { (o: object): boolean; (o: any): false; } +>Object : ObjectConstructor +>isExtensible : { (o: object): boolean; (o: any): false; } +>0 : 0 + +Object.isFrozen(0); +>Object.isFrozen(0) : true +>Object.isFrozen : { (o: object): boolean; (o: any): true; } +>Object : ObjectConstructor +>isFrozen : { (o: object): boolean; (o: any): true; } +>0 : 0 + +Object.isSealed(0); +>Object.isSealed(0) : true +>Object.isSealed : { (o: object): boolean; (o: any): true; } +>Object : ObjectConstructor +>isSealed : { (o: object): boolean; (o: any): true; } +>0 : 0 + +Object.preventExtensions(0); +>Object.preventExtensions(0) : 0 +>Object.preventExtensions : (o: T) => T +>Object : ObjectConstructor +>preventExtensions : (o: T) => T +>0 : 0 + +Object.seal(0); +>Object.seal(0) : 0 +>Object.seal : (o: T) => T +>Object : ObjectConstructor +>seal : (o: T) => T +>0 : 0 + diff --git a/tests/baselines/reference/parserMemberAccessAfterPostfixExpression1.errors.txt b/tests/baselines/reference/parserMemberAccessAfterPostfixExpression1.errors.txt index daab2dd65ec82..67c2adf864e31 100644 --- a/tests/baselines/reference/parserMemberAccessAfterPostfixExpression1.errors.txt +++ b/tests/baselines/reference/parserMemberAccessAfterPostfixExpression1.errors.txt @@ -11,4 +11,4 @@ tests/cases/conformance/parser/ecmascript5/Expressions/parserMemberAccessAfterPo !!! error TS1005: ';' expected. ~~~~~~~~ !!! error TS2552: Cannot find name 'toString'. Did you mean 'String'? -!!! related TS2728 /.ts/lib.es5.d.ts:530:13: 'String' is declared here. \ No newline at end of file +!!! related TS2728 /.ts/lib.es5.d.ts:548:13: 'String' is declared here. \ No newline at end of file diff --git a/tests/baselines/reference/parserRegularExpressionDivideAmbiguity1.errors.txt b/tests/baselines/reference/parserRegularExpressionDivideAmbiguity1.errors.txt index 252a08e5c3874..281f54f5bdc71 100644 --- a/tests/baselines/reference/parserRegularExpressionDivideAmbiguity1.errors.txt +++ b/tests/baselines/reference/parserRegularExpressionDivideAmbiguity1.errors.txt @@ -7,6 +7,6 @@ tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpre /notregexp/a.foo(); ~~~~~~~~~ !!! error TS2552: Cannot find name 'notregexp'. Did you mean 'RegExp'? -!!! related TS2728 /.ts/lib.es5.d.ts:1045:13: 'RegExp' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1063:13: 'RegExp' is declared here. ~ !!! error TS2304: Cannot find name 'a'. \ No newline at end of file diff --git a/tests/baselines/reference/parserRegularExpressionDivideAmbiguity2.errors.txt b/tests/baselines/reference/parserRegularExpressionDivideAmbiguity2.errors.txt index 3eb2b9824267c..e55722adc6acd 100644 --- a/tests/baselines/reference/parserRegularExpressionDivideAmbiguity2.errors.txt +++ b/tests/baselines/reference/parserRegularExpressionDivideAmbiguity2.errors.txt @@ -6,6 +6,6 @@ tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpre (1) /notregexp/a.foo(); ~~~~~~~~~ !!! error TS2552: Cannot find name 'notregexp'. Did you mean 'RegExp'? -!!! related TS2728 /.ts/lib.es5.d.ts:1045:13: 'RegExp' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1063:13: 'RegExp' is declared here. ~ !!! error TS2304: Cannot find name 'a'. \ No newline at end of file diff --git a/tests/baselines/reference/parserS7.2_A1.5_T2.errors.txt b/tests/baselines/reference/parserS7.2_A1.5_T2.errors.txt index d89e7dbdbf68f..58d3ef0f3e9df 100644 --- a/tests/baselines/reference/parserS7.2_A1.5_T2.errors.txt +++ b/tests/baselines/reference/parserS7.2_A1.5_T2.errors.txt @@ -19,7 +19,7 @@ tests/cases/conformance/parser/ecmascript5/parserS7.2_A1.5_T2.ts(20,3): error TS $ERROR('#1: eval("\\u00A0var x\\u00A0= 1\\u00A0"); x === 1. Actual: ' + (x)); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1059:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1077:13: 'Error' is declared here. } //CHECK#2 @@ -28,7 +28,7 @@ tests/cases/conformance/parser/ecmascript5/parserS7.2_A1.5_T2.ts(20,3): error TS $ERROR('#2:  var x = 1 ; x === 1. Actual: ' + (x)); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1059:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1077:13: 'Error' is declared here. } diff --git a/tests/baselines/reference/parserS7.3_A1.1_T2.errors.txt b/tests/baselines/reference/parserS7.3_A1.1_T2.errors.txt index 1b259eccc99b7..507bf4d5943b1 100644 --- a/tests/baselines/reference/parserS7.3_A1.1_T2.errors.txt +++ b/tests/baselines/reference/parserS7.3_A1.1_T2.errors.txt @@ -21,7 +21,7 @@ tests/cases/conformance/parser/ecmascript5/parserS7.3_A1.1_T2.ts(17,3): error TS $ERROR('#1: var\\nx\\n=\\n1\\n; x === 1. Actual: ' + (x)); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1059:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1077:13: 'Error' is declared here. } \ No newline at end of file diff --git a/tests/baselines/reference/parserS7.6_A4.2_T1.errors.txt b/tests/baselines/reference/parserS7.6_A4.2_T1.errors.txt index 3e7acb4d3f164..bb249411ff903 100644 --- a/tests/baselines/reference/parserS7.6_A4.2_T1.errors.txt +++ b/tests/baselines/reference/parserS7.6_A4.2_T1.errors.txt @@ -50,70 +50,70 @@ tests/cases/conformance/parser/ecmascript5/parserS7.6_A4.2_T1.ts(142,3): error T $ERROR('#А'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1059:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1077:13: 'Error' is declared here. } var \u0411 = 1; if (Б !== 1) { $ERROR('#Б'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1059:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1077:13: 'Error' is declared here. } var \u0412 = 1; if (В !== 1) { $ERROR('#В'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1059:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1077:13: 'Error' is declared here. } var \u0413 = 1; if (Г !== 1) { $ERROR('#Г'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1059:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1077:13: 'Error' is declared here. } var \u0414 = 1; if (Д !== 1) { $ERROR('#Д'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1059:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1077:13: 'Error' is declared here. } var \u0415 = 1; if (Е !== 1) { $ERROR('#Е'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1059:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1077:13: 'Error' is declared here. } var \u0416 = 1; if (Ж !== 1) { $ERROR('#Ж'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1059:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1077:13: 'Error' is declared here. } var \u0417 = 1; if (З !== 1) { $ERROR('#З'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1059:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1077:13: 'Error' is declared here. } var \u0418 = 1; if (И !== 1) { $ERROR('#И'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1059:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1077:13: 'Error' is declared here. } var \u0419 = 1; if (Й !== 1) { $ERROR('#Й'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1059:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1077:13: 'Error' is declared here. } var \u041A = 1; if (К !== 1) { diff --git a/tests/baselines/reference/parserUnicode1.errors.txt b/tests/baselines/reference/parserUnicode1.errors.txt index d2f7148f6f271..fa74ab5b60bb1 100644 --- a/tests/baselines/reference/parserUnicode1.errors.txt +++ b/tests/baselines/reference/parserUnicode1.errors.txt @@ -11,13 +11,13 @@ tests/cases/conformance/parser/ecmascript5/parserUnicode1.ts(10,5): error TS2552 $ERROR('#6.1: var \\u0078x = 1; xx === 6. Actual: ' + (xx)); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1059:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1077:13: 'Error' is declared here. } } catch (e) { $ERROR('#6.2: var \\u0078x = 1; xx === 6. Actual: ' + (xx)); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1059:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1077:13: 'Error' is declared here. } \ No newline at end of file diff --git a/tests/baselines/reference/parserUsingConstructorAsIdentifier.types b/tests/baselines/reference/parserUsingConstructorAsIdentifier.types index 0034fa0e136e5..29122ff0c0f67 100644 --- a/tests/baselines/reference/parserUsingConstructorAsIdentifier.types +++ b/tests/baselines/reference/parserUsingConstructorAsIdentifier.types @@ -90,9 +90,9 @@ Object.defineProperty(constructor.prototype, "constructor", { value: constructor, writable: true, configurable: true, enumerable: true }); >Object.defineProperty(constructor.prototype, "constructor", { value: constructor, writable: true, configurable: true, enumerable: true }) : any ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >constructor.prototype : any >constructor : any >prototype : any diff --git a/tests/baselines/reference/promisePermutations.errors.txt b/tests/baselines/reference/promisePermutations.errors.txt index c9862aec4ec6c..6613b94c29697 100644 --- a/tests/baselines/reference/promisePermutations.errors.txt +++ b/tests/baselines/reference/promisePermutations.errors.txt @@ -447,7 +447,7 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2769: No overload m !!! error TS2769: The last overload gave the following error. !!! error TS2769: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. !!! error TS2769: Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. -!!! related TS2728 /.ts/lib.es5.d.ts:1535:5: 'catch' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1553:5: 'catch' is declared here. !!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); // ok diff --git a/tests/baselines/reference/promisePermutations2.errors.txt b/tests/baselines/reference/promisePermutations2.errors.txt index 17ac4d4aa3c72..67900b723f814 100644 --- a/tests/baselines/reference/promisePermutations2.errors.txt +++ b/tests/baselines/reference/promisePermutations2.errors.txt @@ -351,7 +351,7 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of ~~~~~~~~~ !!! error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. !!! error TS2345: Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. -!!! related TS2728 /.ts/lib.es5.d.ts:1535:5: 'catch' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1553:5: 'catch' is declared here. var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); // ok var r11: IPromise; diff --git a/tests/baselines/reference/promisePermutations3.errors.txt b/tests/baselines/reference/promisePermutations3.errors.txt index 835c3fcb71bcf..25fe83786ec7e 100644 --- a/tests/baselines/reference/promisePermutations3.errors.txt +++ b/tests/baselines/reference/promisePermutations3.errors.txt @@ -398,7 +398,7 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of !!! error TS2769: The last overload gave the following error. !!! error TS2769: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. !!! error TS2769: Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. -!!! related TS2728 /.ts/lib.es5.d.ts:1535:5: 'catch' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1553:5: 'catch' is declared here. !!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); // ok @@ -445,5 +445,5 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of ~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '{ (x: T): IPromise; (x: T, y: T): Promise; }' is not assignable to parameter of type '(value: (x: any) => any) => Promise'. !!! error TS2345: Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. -!!! related TS2728 /.ts/lib.es5.d.ts:1535:5: 'catch' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1553:5: 'catch' is declared here. var s12c = s12.then(testFunction12P, testFunction12, testFunction12); // ok \ No newline at end of file diff --git a/tests/baselines/reference/redefineArray.errors.txt b/tests/baselines/reference/redefineArray.errors.txt index 0af9576082efa..5bb5b0dd057ca 100644 --- a/tests/baselines/reference/redefineArray.errors.txt +++ b/tests/baselines/reference/redefineArray.errors.txt @@ -5,4 +5,4 @@ tests/cases/compiler/redefineArray.ts(1,1): error TS2741: Property 'isArray' is Array = function (n:number, s:string) {return n;}; ~~~~~ !!! error TS2741: Property 'isArray' is missing in type '(n: number, s: string) => number' but required in type 'ArrayConstructor'. -!!! related TS2728 /.ts/lib.es5.d.ts:1486:5: 'isArray' is declared here. \ No newline at end of file +!!! related TS2728 /.ts/lib.es5.d.ts:1504:5: 'isArray' is declared here. \ No newline at end of file diff --git a/tests/baselines/reference/scannerS7.2_A1.5_T2.errors.txt b/tests/baselines/reference/scannerS7.2_A1.5_T2.errors.txt index 535cc4b2f970f..b33f17f6ed46f 100644 --- a/tests/baselines/reference/scannerS7.2_A1.5_T2.errors.txt +++ b/tests/baselines/reference/scannerS7.2_A1.5_T2.errors.txt @@ -19,7 +19,7 @@ tests/cases/conformance/scanner/ecmascript5/scannerS7.2_A1.5_T2.ts(20,3): error $ERROR('#1: eval("\\u00A0var x\\u00A0= 1\\u00A0"); x === 1. Actual: ' + (x)); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1059:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1077:13: 'Error' is declared here. } //CHECK#2 @@ -28,7 +28,7 @@ tests/cases/conformance/scanner/ecmascript5/scannerS7.2_A1.5_T2.ts(20,3): error $ERROR('#2:  var x = 1 ; x === 1. Actual: ' + (x)); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1059:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1077:13: 'Error' is declared here. } diff --git a/tests/baselines/reference/scannerS7.3_A1.1_T2.errors.txt b/tests/baselines/reference/scannerS7.3_A1.1_T2.errors.txt index 40c4e573c779d..dc486a297f548 100644 --- a/tests/baselines/reference/scannerS7.3_A1.1_T2.errors.txt +++ b/tests/baselines/reference/scannerS7.3_A1.1_T2.errors.txt @@ -21,7 +21,7 @@ tests/cases/conformance/scanner/ecmascript5/scannerS7.3_A1.1_T2.ts(17,3): error $ERROR('#1: var\\nx\\n=\\n1\\n; x === 1. Actual: ' + (x)); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1059:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1077:13: 'Error' is declared here. } \ No newline at end of file diff --git a/tests/baselines/reference/scannerS7.6_A4.2_T1.errors.txt b/tests/baselines/reference/scannerS7.6_A4.2_T1.errors.txt index ba258b4f255c3..e3c2501c35391 100644 --- a/tests/baselines/reference/scannerS7.6_A4.2_T1.errors.txt +++ b/tests/baselines/reference/scannerS7.6_A4.2_T1.errors.txt @@ -50,70 +50,70 @@ tests/cases/conformance/scanner/ecmascript5/scannerS7.6_A4.2_T1.ts(142,3): error $ERROR('#А'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1059:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1077:13: 'Error' is declared here. } var \u0411 = 1; if (Б !== 1) { $ERROR('#Б'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1059:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1077:13: 'Error' is declared here. } var \u0412 = 1; if (В !== 1) { $ERROR('#В'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1059:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1077:13: 'Error' is declared here. } var \u0413 = 1; if (Г !== 1) { $ERROR('#Г'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1059:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1077:13: 'Error' is declared here. } var \u0414 = 1; if (Д !== 1) { $ERROR('#Д'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1059:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1077:13: 'Error' is declared here. } var \u0415 = 1; if (Е !== 1) { $ERROR('#Е'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1059:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1077:13: 'Error' is declared here. } var \u0416 = 1; if (Ж !== 1) { $ERROR('#Ж'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1059:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1077:13: 'Error' is declared here. } var \u0417 = 1; if (З !== 1) { $ERROR('#З'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1059:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1077:13: 'Error' is declared here. } var \u0418 = 1; if (И !== 1) { $ERROR('#И'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1059:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1077:13: 'Error' is declared here. } var \u0419 = 1; if (Й !== 1) { $ERROR('#Й'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1059:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1077:13: 'Error' is declared here. } var \u041A = 1; if (К !== 1) { diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt index a9e6e98b25080..521a870cb1997 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt @@ -38,7 +38,7 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio ~~ !!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. !!! error TS2345: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. -!!! related TS2728 /.ts/lib.es5.d.ts:608:14: 'raw' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:626:14: 'raw' is declared here. !!! related TS2793 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts:5:10: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. var b = foo([], 1); // string ~~ diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt index 6997efce9afd2..1e37485f182ae 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt @@ -38,7 +38,7 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio ~~ !!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. !!! error TS2345: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. -!!! related TS2728 /.ts/lib.es5.d.ts:608:14: 'raw' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:626:14: 'raw' is declared here. !!! related TS2793 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts:5:10: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. var b = foo([], 1); // string ~~ diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt index 13147855b73b1..01c3cec2949d3 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt @@ -113,7 +113,7 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio fn5 `${ (n) => n.toFixed() }`; // will error; 'n' should have type 'string'. ~~~~~~~ !!! error TS2551: Property 'toFixed' does not exist on type 'string'. Did you mean 'fixed'? -!!! related TS2728 /.ts/lib.es2015.core.d.ts:485:5: 'fixed' is declared here. +!!! related TS2728 /.ts/lib.es2015.core.d.ts:492:5: 'fixed' is declared here. fn5 `${ (n) => n.substr(0) }`; \ No newline at end of file diff --git a/tests/baselines/reference/unionAndIntersectionInference1.symbols b/tests/baselines/reference/unionAndIntersectionInference1.symbols index 815e70ddce106..c3591912e67e4 100644 --- a/tests/baselines/reference/unionAndIntersectionInference1.symbols +++ b/tests/baselines/reference/unionAndIntersectionInference1.symbols @@ -272,9 +272,9 @@ const assign = (a: T, b: U) => Object.assign(a, b); >T : Symbol(T, Decl(unionAndIntersectionInference1.ts, 94, 16)) >b : Symbol(b, Decl(unionAndIntersectionInference1.ts, 94, 27)) >U : Symbol(U, Decl(unionAndIntersectionInference1.ts, 94, 18)) ->Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >a : Symbol(a, Decl(unionAndIntersectionInference1.ts, 94, 22)) >b : Symbol(b, Decl(unionAndIntersectionInference1.ts, 94, 27)) diff --git a/tests/baselines/reference/unionAndIntersectionInference1.types b/tests/baselines/reference/unionAndIntersectionInference1.types index ec56cbbd1c4ac..3979a3a7bdb9f 100644 --- a/tests/baselines/reference/unionAndIntersectionInference1.types +++ b/tests/baselines/reference/unionAndIntersectionInference1.types @@ -241,22 +241,22 @@ const func = () => {}; >() => {} : () => void const assign = (a: T, b: U) => Object.assign(a, b); ->assign : (a: T, b: U) => T & U ->(a: T, b: U) => Object.assign(a, b) : (a: T, b: U) => T & U +>assign : (a: T, b: U) => T & Writable +>(a: T, b: U) => Object.assign(a, b) : (a: T, b: U) => T & Writable >a : T >b : U ->Object.assign(a, b) : T & U ->Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>Object.assign(a, b) : T & Writable +>Object.assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } >Object : ObjectConstructor ->assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } >a : T >b : U const res: (() => void) & { func: any } = assign(() => {}, { func }); >res : (() => void) & { func: any; } >func : any ->assign(() => {}, { func }) : (() => void) & { func: () => void; } ->assign : (a: T, b: U) => T & U +>assign(() => {}, { func }) : (() => void) & Writable<{ func: () => void; }> +>assign : (a: T, b: U) => T & Writable >() => {} : () => void >{ func } : { func: () => void; } >func : () => void diff --git a/tests/cases/compiler/objectMethodNullability.ts b/tests/cases/compiler/objectMethodNullability.ts new file mode 100644 index 0000000000000..4c3038be83c7e --- /dev/null +++ b/tests/cases/compiler/objectMethodNullability.ts @@ -0,0 +1,51 @@ +// @lib: esnext +// @strict: true + +// All of the following should produce an error: + +Object.assign(undefined); +Object.create(undefined); +Object.defineProperties(undefined, {}); +Object.defineProperty(undefined, "foo", {}); +Object.entries(undefined); +Object.getOwnPropertyDescriptor(undefined, "foo"); +Object.getOwnPropertyDescriptors(undefined); +Object.getOwnPropertyNames(undefined); +Object.getOwnPropertySymbols(undefined); +Object.getPrototypeOf(undefined); +Object.hasOwn(undefined, "foo"); +Object.keys(undefined); +Object.setPrototypeOf(undefined, {}); +Object.values(undefined); + +Object.create(0); +Object.defineProperties(0, {}); +Object.defineProperty(0, "foo", {}); + +// While the following should not: + +Object.assign(0); +Object.entries(0); +Object.getOwnPropertyDescriptor(0, "foo"); +Object.getOwnPropertyDescriptors(0); +Object.getOwnPropertyNames(0); +Object.getOwnPropertySymbols(0); +Object.getPrototypeOf(0); +Object.hasOwn(0, "foo"); +Object.keys(0); +Object.setPrototypeOf(0, {}); +Object.values(0); + +Object.freeze(undefined); +Object.isExtensible(undefined); +Object.isFrozen(undefined); +Object.isSealed(undefined); +Object.preventExtensions(undefined); +Object.seal(undefined); + +Object.freeze(0); +Object.isExtensible(0); +Object.isFrozen(0); +Object.isSealed(0); +Object.preventExtensions(0); +Object.seal(0); From 65bbb0c8e54bcf1d1a2b776269aa81b085aa68eb Mon Sep 17 00:00:00 2001 From: graphemecluster Date: Wed, 9 Nov 2022 10:07:11 +0800 Subject: [PATCH 2/2] TypeScript bug discovered --- src/testRunner/parallel/worker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/testRunner/parallel/worker.ts b/src/testRunner/parallel/worker.ts index 57538ea26b81c..33b91b6f4ea33 100644 --- a/src/testRunner/parallel/worker.ts +++ b/src/testRunner/parallel/worker.ts @@ -185,7 +185,7 @@ export function start() { newSuite.addTest(test); root.addSuite(newSuite); Object.setPrototypeOf(newSuite.ctx, root.ctx); - Object.setPrototypeOf(test.ctx, root.ctx); + Object.setPrototypeOf(test.ctx!, root.ctx); test.parent = newSuite; suite = newSuite; }