-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Resolve apparent mapped types recursively #57091
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
Resolve apparent mapped types recursively #57091
Conversation
constraint = getApparentType(modifiersConstraint); | ||
const modifiersType = getModifiersTypeFromMappedType(type); | ||
if (modifiersType) { | ||
constraint = getApparentType(getConstraintOfType(modifiersType) || modifiersType); |
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.
I'm not particularly fond of this - maybe there is a better way of doing this. This mainly tries to get the apparent type of the modifiers type when the modifiers type is a mapped type itself (like in Mapped<Mapped2<Foo>>
). Mapped types don't return anything from getConstraintOfType
.
The test failure doesn't surprise me. It would pass if another problem would get fixed - the one that is being tackled by #50034 The recursive resolution here just uncovers the fact that this other thing doesn't exactly work properly - as far as I was able to investigate so far and I spent 2 nights on this. |
@typescript-bot run DT |
Heya @gabritto, I've started to run the parallelized Definitely Typed test suite on this PR at 342f700. You can monitor the build here. Update: The results are in! |
Heya @gabritto, I've started to run the regular perf test suite on this PR at 342f700. You can monitor the build here. Update: The results are in! |
Heya @gabritto, I've started to run the diff-based top-repos suite on this PR at 342f700. You can monitor the build here. Update: The results are in! |
Heya @gabritto, I've started to run the diff-based user code test suite on this PR at 342f700. You can monitor the build here. Update: The results are in! |
@gabritto Here are the results of running the user test suite comparing There were infrastructure failures potentially unrelated to your change:
Otherwise... Something interesting changed - please have a look. Details
|
@gabritto Here they are:
tscComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
tsserverComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
startupComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
Developer Information: |
Hey @gabritto, the results of running the DT tests are ready. |
@gabritto Here are the results of running the top-repos suite comparing Something interesting changed - please have a look. Details
|
This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise. |
I pushed out a test case that shows how this is an improvement. It fixes the VS Code's build failure that @jakebailey reported post-merge here. It's obviously not perfect right now because |
superseded by #57122 |
this expands on #56727
I'm opening this as a draft but I'd love it if somebody could run an extended test suite on this PR in the meantime (cc @gabritto )