-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Cache propagating variance flags in the relationship cache #32225
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
Cache propagating variance flags in the relationship cache #32225
Conversation
The whole shebang of extra tests: |
Heya @weswigham, I've started to run the community code test suite on this PR at c4f96b6. You can monitor the build here. It should now contribute to this PR's status checks. |
Heya @weswigham, I've started to run the perf test suite on this PR at c4f96b6. You can monitor the build here. It should now contribute to this PR's status checks. Update: The results are in! |
Heya @weswigham, I've started to run the parallelized Definitely Typed test suite on this PR at c4f96b6. You can monitor the build here. It should now contribute to this PR's status checks. |
Heya @weswigham, I've started to run the extended test suite on this PR at c4f96b6. You can monitor the build here. It should now contribute to this PR's status checks. |
@weswigham Here they are:Comparison Report - master..32225
System
Hosts
Scenarios
|
The user suite test run you requested has finished and failed. I've opened a PR with the baseline diff from master. |
I'm getting really curious, could somebody explain to exactly me why TypeScript needs to measure variance? I've never understood that. A type parameter is either co-, contra-, in- or bivariant: I don't understand what there is to quantify. Especially since structural typing (in theory) should mean the variance is implicit in the structure, right? |
It is - we measure the variance so we can avoid comparing the parts of the type we know are identical and just compare the type parameters as is appropriate for the structure they are contained within. |
RWC and user suite failures are with diffs identical to |
c4f96b6
to
0a555c7
Compare
Hooray! Thank you @weswigham |
A sequel to #31688.
Fixes #32209
This allows
Unreliable
andUnmeasurable
variances to propagate even for those types which are not references and do not have alias symbols. The downside is that the exact nuance of which type parameter position within the type is unreliable/unmeasurable is lost (but that isn't really recoverable for non-alias-symbol/type-reference types anyway).