Uh oh!
There was an error while loading. Please reload this page.
Empty object not subtype of object with index signature - #50013
Empty object not subtype of object with index signature#50013Anders Hejlsberg (ahejlsberg) wants to merge 3 commits into
Conversation
Anders Hejlsberg (ahejlsberg)
commented
Jul 22, 2022
TypeScript Bot (@typescript-bot) test this |
Heya Anders Hejlsberg (@ahejlsberg), I've started to run the extended test suite on this PR at c7b2942. You can monitor the build here. |
Heya Anders Hejlsberg (@ahejlsberg), I've started to run the parallelized Definitely Typed test suite on this PR at c7b2942. You can monitor the build here. |
Heya Anders Hejlsberg (@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 Anders Hejlsberg (@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! |
TypeScript Bot (typescript-bot)
commented
Jul 23, 2022
Anders Hejlsberg (@ahejlsberg) Here they are:Comparison Report - main..50013
System
Hosts
Scenarios
Developer Information: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
TypeScript Bot (typescript-bot)
commented
Jul 23, 2022
Heya Anders Hejlsberg (@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. |
TypeScript Bot (typescript-bot)
commented
Jul 23, 2022
Anders Hejlsberg (@ahejlsberg) |
| >values3 : any[] | ||
| >Object.values({}) : any[] |
There was a problem hiding this comment.
q: is this a desired change?
Anders Hejlsberg (ahejlsberg)
commented
Jul 26, 2022
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.