-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Empty object not subtype of object with index signature #50013
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
Conversation
@typescript-bot test this |
Heya @ahejlsberg, I've started to run the extended test suite on this PR at c7b2942. You can monitor the build here. |
Heya @ahejlsberg, I've started to run the parallelized Definitely Typed test suite on this PR at c7b2942. You can monitor the build here. |
Heya @ahejlsberg, I've started to run the abridged perf test suite on this PR at c7b2942. You can monitor the build here. Update: The results are in! |
Heya @ahejlsberg, I've started to run the diff-based user code test suite on this PR at c7b2942. You can monitor the build here. Update: The results are in! |
@ahejlsberg Here they are:Comparison Report - main..50013
System
Hosts
Scenarios
Developer Information: |
Heya @ahejlsberg, I've run the RWC suite on this PR - assuming you're on the TS core team, you can view the resulting diff here. |
@ahejlsberg |
>values3 : any[] | ||
>Object.values({}) : any[] |
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.
q: is this a desired change?
Closing in favor of #50044. |
This PR tightens the subtype relation such that a non-fresh
{}
is not considered a subtype of{ [x: string]: xxx }
. Currently, such types are subtypes in both directions, which causes issues in narrowing.This fixes the issue reported here.