Skip to content
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

Mark deep indexed access comparisons as expanding #33144

Conversation

weswigham
Copy link
Member

@weswigham weswigham commented Aug 29, 2019

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
Member Author

@typescript-bot test this
@typescript-bot run dt
@typescript-bot user test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Aug 29, 2019

Heya @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
Copy link
Collaborator

typescript-bot commented Aug 29, 2019

Heya @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
Copy link
Collaborator

typescript-bot commented Aug 29, 2019

Heya @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
Member Author

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

@typescript-bot
Copy link
Collaborator

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
Member Author

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

@weswigham
Copy link
Member Author

@typescript-bot pack this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Sep 2, 2019

Heya @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
Collaborator

Hey @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
Copy link

alfaproject commented Sep 2, 2019

I wonder if this would also fix:

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

@odlings
Copy link

odlings commented Sep 3, 2019

@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.

@sandersn sandersn added this to the TypeScript 3.6.3 milestone Sep 4, 2019
@weswigham 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
Member Author

@typescript-bot cherry-pick this into release-3.6

@typescript-bot
Copy link
Collaborator

Hey @weswigham, I've opened #33249 for you.

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 weswigham merged commit 72bb4c2 into microsoft:master Sep 5, 2019
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 join this conversation on GitHub. Already have an account? Sign in to comment
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