-
Notifications
You must be signed in to change notification settings - Fork 12.8k
lib Fix Part 3/6 – Object related methods #50451
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
lib Fix Part 3/6 – Object related methods #50451
Conversation
@typescript-bot run dt |
Heya @sandersn, I've started to run the diff-based user code test suite on this PR at 8b640be. You can monitor the build here. Update: The results are in! |
Heya @sandersn, I've started to run the diff-based top-repos suite on this PR at 8b640be. You can monitor the build here. Update: The results are in! |
@sandersn Here are the results of running the user test suite comparing Something interesting changed - please have a look. Details
|
@sandersn Here are the results of running the top-repos suite comparing Something interesting changed - please have a look. Details
|
Great, TypeScript bug discovered! (Temporarily fixed with a non-null assertion) |
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes are not actually correct, as object
is a subtype of any
, and thus, a variable that is a union of object
and non‑object
will cause the second overload to be selected.
Hi, is it possible to revisit this stalled PR, specifically for |
General Information
PR separated out from #49855, because there might be some members expecting smaller PRs. As mentioned in the comments from the big PR, whether to review a single, large PR or 6 smaller PRs is up to the TypeScript Team to decide. I couldn't have found a better way for this; hopefully this will not bring any trouble to the Team.
This PR partially fixes #49773.
For details and the track list about the changes, please see #49773.
Part 3/6, Object related methods
Fix #31175
Fix #24509 as a side-effect
🟠 Breaking Change
Quoted from #49773: