Skip to content

Mark deep indexed access comparisons as expanding - #33144

Merged
Wesley Wigham (weswigham) merged 2 commits into
microsoft:masterfrom
weswigham:mark-deep-indexed-access-comparisons-as-expanding
Sep 5, 2019
Merged

Wesley Wigham (weswigham) merged 2 commits into
microsoft:masterfrom
weswigham:mark-deep-indexed-access-comparisons-as-expanding

Conversation

@weswigham

@weswigham Wesley Wigham (weswigham) commented Aug 29, 2019 •

Copy link
Copy Markdown
Member

Fixes #33132

Just as isDeeplyNestedType marks objects which re-nest >5 times as maybe infinitely expanding, it now also marks indexed accesses which nest >5 times in the same way. Since a deeply nested indexed access is essentially the dual of a deeply nested object type (or at least you'd need a deeply nested object to satisfy the indexing operations!), this makes sense to me.

@weswigham

Copy link
Copy Markdown
Member Author

@typescript-bot

TypeScript Bot (typescript-bot) commented Aug 29, 2019 •

Copy link
Copy Markdown
Contributor

Heya Wesley Wigham (@weswigham), I've started to run the extended test suite on this PR at 7861cf4. You can monitor the build here. It should now contribute to this PR's status checks.

@typescript-bot

TypeScript Bot (typescript-bot) commented Aug 29, 2019 •

Copy link
Copy Markdown
Contributor

Heya Wesley Wigham (@weswigham), I've started to run the parallelized community code test suite on this PR at 7861cf4. You can monitor the build here. It should now contribute to this PR's status checks.

@typescript-bot

TypeScript Bot (typescript-bot) commented Aug 29, 2019 •

Copy link
Copy Markdown
Contributor

Heya Wesley Wigham (@weswigham), I've started to run the parallelized Definitely Typed test suite on this PR at 7861cf4. You can monitor the build here. It should now contribute to this PR's status checks.

@weswigham

Copy link
Copy Markdown
Member Author

cc Daniel Rosenwasser (@DanielRosenwasser) since the referenced issue is reported as a regression in the 3.6 release~

@typescript-bot

Copy link
Copy Markdown
Contributor

The user suite test run you requested has finished and failed. I've opened a PR with the baseline diff from master.

@weswigham

Copy link
Copy Markdown
Member Author

User baselines are just today's as yet uncaptured/accepted update (just changes in upstream projects), so are clean~

@weswigham

Copy link
Copy Markdown
Member Author

TypeScript Bot (@typescript-bot) pack this

@typescript-bot

TypeScript Bot (typescript-bot) commented Sep 2, 2019 •

Copy link
Copy Markdown
Contributor

Heya Wesley Wigham (@weswigham), I've started to run the tarball bundle task on this PR at 7861cf4. You can monitor the build here. It should now contribute to this PR's status checks.

@typescript-bot

Copy link
Copy Markdown
Contributor

Hey Wesley Wigham (@weswigham), I've packed this into an installable tgz. You can install it for testing by referencing it in your package.json like so:

{
    "devDependencies": {
        "typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/42509/artifacts?artifactName=tgz&fileId=A82D59BA80DA6FD462A65482799F16EB7C4F6BC924F2F7C4276F7E36EA2B62E702&fileName=/typescript-3.7.0-insiders.20190902.tgz"
    }
}

and then running npm install.

@alfaproject

João Dias (alfaproject) commented Sep 2, 2019 •

Copy link
Copy Markdown

I wonder if this would also fix:

Edit: Wesley Wigham (@weswigham) I can confirm that this fixes my comment in this older issue: #29112 (comment)

@odlings

odlings commented Sep 3, 2019

Copy link
Copy Markdown

Wesley Wigham (@weswigham) The insiders build fixes the issue I was having as well with

TS2321: Excessive stack depth comparing types 'LoDashExplicitWrapper<?>' and 'LoDashExplicitWrapper<?>'.

and

TS2589: Type instantiation is excessively deep and possibly infinite.

For now I've had to rollback to 3.5 as my choice is 3.6 and removing @types/lodash or 3.5 and have proper types for lodash.

@weswigham
Wesley Wigham (weswigham) force-pushed the mark-deep-indexed-access-comparisons-as-expanding branch from 7861cf4 to 67fbdfa Compare September 4, 2019 21:08
@weswigham

Copy link
Copy Markdown
Member Author

TypeScript Bot (@typescript-bot) cherry-pick this into release-3.6

@typescript-bot

Copy link
Copy Markdown
Contributor

Hey Wesley Wigham (@weswigham), I've opened #33249 for you.

TypeScript Bot (typescript-bot) pushed a commit to typescript-bot/TypeScript that referenced this pull request Sep 4, 2019
Component commits:
028fa8e mark deep indexed accesses as deeply nested in comparisons

67fbdfa Add test derived from lodash example
@weswigham
Wesley Wigham (weswigham) merged commit 72bb4c2 into microsoft:master Sep 5, 2019
Wesley Wigham (weswigham) pushed a commit that referenced this pull request Sep 5, 2019
Component commits:
028fa8e mark deep indexed accesses as deeply nested in comparisons

67fbdfa Add test derived from lodash example
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3.6 regression: error TS2321: Excessive stack depth comparing types 'Function<?>' and 'Function<?>'.

6 participants