Allow nested reverse mapped type printback#42485
Conversation
|
@typescript-bot perf test this |
|
Heya @weswigham, I've started to run the parallelized Definitely Typed test suite on this PR at 84241ef. You can monitor the build here. |
|
Heya @weswigham, I've started to run the perf test suite on this PR at 84241ef. You can monitor the build here. Update: The results are in! |
|
Heya @weswigham, I've started to run the extended test suite on this PR at 84241ef. You can monitor the build here. |
|
Heya @weswigham, I've started to run the parallelized community code test suite on this PR at 84241ef. You can monitor the build here. |
|
@weswigham Here they are:Comparison Report - master..42485
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. |
sandersn
left a comment
There was a problem hiding this comment.
- I like the behaviour change,
- agree with the index access simplification
- have a question about the nested printback
- don't feel qualified to OK the caching change (perf tests help here although I don't think we test mapped types at all on them)
When the reverse mapped type in question both isn't already being printed, and isn't the child type of a reverse mapping over a non-anonymous type (eg,
WindoworNumber). This means that reverse mappings over object literal expression types should be printed back in full, rather than getting truncated.To support this change, I've added caching into reverse mapped symbol type lookup (previously we'd redo the inference every time we asked for the type of the symbol), and introduced a simplification into the construction of reverse mapped symbols so we manufacture less type identities when doing deep reverse mappings (by recognizing that
{[K in keyof T[K_1]]: Whatever<T[K_1]>]}is equivalent to{[K in keyof T]: Whatever<T>]}as far as reverse mapped symbol type inference is concerned). Without that, we'd manufacture new sets of type identities for every type mapped over for every level "down" we had to recur within a deeply-reverse mapped type.Fixes #40003 in most cases.