Add explicit type variance specifiers to Promise, Map, Set #62973
+78
−77
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #62954
In theory this could improve the performance of type checking in certain scenarios by avoiding a call to
getVariancesWorkeras measured in the perfetto profiles.I've opted to only include some of the most commonly used types, so the added parsing time doesn't outweigh the benefits
I wasn't sure if the explicit specifier needs to be on every expansion of an interface or only the first one, so I've added it to all of them from es5 to esnext, but depending on how the compiler handles it, it could be applied only to the first occurrence of the interface