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

Elevate mapped types over type parameters in the same way as naked type parameters in intersection inference prioritization #33223

Conversation

weswigham
Copy link
Member

@weswigham weswigham commented Sep 3, 2019

Fixes #33164

We should probably investigate if in the other places in inference where we check getInferenceInfoForType we should also be checking in a passthru-type way for homomrphic mapped types over a targeted type parameter, as I do here in the intersection case.

@weswigham weswigham changed the title Elevate mapped types over type parameters in the same way as naked ty… Elevate mapped types over type parameters in the same way as naked type parameters in intersection inference prioritization Sep 3, 2019
@weswigham
Copy link
Member Author

@typescript-bot run dt
@typescript-bot test this
@typescript-bot user test this
@typescript-bot pack this for those vue people to validate that this fix applies in a non-minimized scenario

@typescript-bot
Copy link
Collaborator

typescript-bot commented Sep 3, 2019

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Sep 3, 2019

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Sep 3, 2019

Heya @weswigham, I've started to run the tarball bundle task on this PR at 8bc3d76. You can monitor the build here. It should now contribute to this PR's status checks.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Sep 3, 2019

Heya @weswigham, I've started to run the extended test suite on this PR at 8bc3d76. 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/42647/artifacts?artifactName=tgz&fileId=6BD8376EF107FCDA03E661535DC92C380F628B1D6BE5DF60E07E81BA3E2F128E02&fileName=/typescript-3.7.0-insiders.20190903.tgz"
    }
}

and then running npm install.

@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 suite seems fine - it's just this morning's changes in the azure sdk (which I just accepted), plus today's continuing changes in vecode's build (they've patched their build to workaround issues with @types/node and ts 3.6), and office ui fabric (which is just some test updates).

@weswigham
Copy link
Member Author

And RWC and DT are both clean, nice.

…pe parameters in intersection inference prioritization
@weswigham weswigham force-pushed the fix-homomorphic-mapped-types-in-intersection-inferences branch from 8bc3d76 to a2b3af2 Compare September 3, 2019 23:25
@sandersn sandersn added this to the TypeScript 3.6.3 milestone Sep 4, 2019
@weswigham
Copy link
Member Author

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

typescript-bot pushed a commit to typescript-bot/TypeScript that referenced this pull request Sep 4, 2019
Component commits:
a2b3af2 Elevate mapped types over type parameters in the same way as naked type parameters in intersection inference prioritization
@typescript-bot
Copy link
Collaborator

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

@weswigham weswigham merged commit 3109b64 into microsoft:master Sep 4, 2019
weswigham pushed a commit that referenced this pull request Sep 4, 2019
Component commits:
a2b3af2 Elevate mapped types over type parameters in the same way as naked type parameters in intersection inference prioritization
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.

Wrong type parameter inference when there is mapped types and Readonly in the argument type
4 participants