Merged
Conversation
|
🎉 This PR is included in version 4.1.7 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Under compiler version 5.7.2 (or more specifically since PR microsoft/TypeScript#52095) TypeScript will more eagerly instantiate generic types when intersections are involved. This causes all variables in the generic input type in TGB to be inferred as having type
unknown#85To prevent this from happening, we insert a dummy conditional type that involves the generic type. This causes the compiler to defer instantiating the
ExactArgNamesrestriction and instead use other types to do the generic inference, restoring correct variable type inference.I feel that at this point we're too reliant on implementation details of the typescript compiler, and while this patch fixes the immediate problem, a response from the TypeScript team would be much appreciated to make better decisions on the direction going forward.