[release/8.0-staging] Fix problem in ReadyToRun_TypeGenericInfoMap::HasConstraints (Recovery PR)#105835
Merged
ivdiazsa merged 1 commit intodotnet:release/8.0-stagingfrom Aug 6, 2024
Conversation
lambdageek
approved these changes
Aug 1, 2024
Member
|
This was already approved by tactics in #105728 |
jeffschwMSFT
approved these changes
Aug 1, 2024
Member
jeffschwMSFT
left a comment
There was a problem hiding this comment.
lgtm. we have approval from tactics
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
(Recovery of PR #105728 that was accidentally shut down)
Customer Impact
Backport of PR #96358 to release/8.0. This bug came to light as reported by a customer in issue #96225. Since it reproduces on .NET 8 but was gone by .NET 9 preview 1, some further bisecting was done to figure out the fix.
The problem was that the code in the VM that is supposed to check for whether a generic type had (a) constraining clause(s), actually checked for whether said type was either covariant or contravariant. This completely different and therefore erroneous behavior broke some scenarios with generics and made them crash, like the one hindering our customer in this case.
Regression
This is a regression as the same scenario works properly in .NET 7 and .NET 6 versions. For context, it was accidentally introduced in this PR: #85743
Testing
This was validated using the customer's failing repro scenarios.
Risk
This PR poses little to no risk to the product. Since it's a small and simple one, we decided it would be a convenient and easy backport. The failure is well understood and has a well defined scope.