Skip to content

Conversation

@davidwrighton
Copy link
Member

@davidwrighton davidwrighton commented Feb 8, 2024

Fixes Issue #97667 and #97807

main PR PR #97733

Description

When an application uses the curiously recurring generics pattern in combination with a base generic type which is constrained over that pattern, the .NET 8.0 runtime will fail with a constraint checking exception. (There is also a small reflection visible impact)

Customer Impact

Customer applications which worked in .NET 7 and below are unable to be ported to .NET 8,

Regression

Yes, this is a regression in .NET 8. In .NET 7, the problematic type loading behavior was introduced with an issue that masked this issue, in .NET 8 it was 'fixed' (#PR 78619). Now that constraints are being properly checked it exposed that the runtime was failing on valid applications.

Testing

2 customer repro cases, which were independently reported in the span of a week have been verified to work with this fix. In addition, the fix contains an update to a test case we already had to verify the behavior.

Risk

Fairly low. It only changes the behavior of the runtime in a very targeted way.

Package authoring signed off?

N/A, this code does not affect code which ships in a NuGet package

…) to release/8.0-staging

- Reflection IsAssignableFrom api
- As well as constraint checking
@ghost ghost assigned davidwrighton Feb 8, 2024
@davidwrighton davidwrighton added the Servicing-consider Issue for next servicing release review label Feb 8, 2024
Copy link
Member

@jeffschwMSFT jeffschwMSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved. we will take for consideration in 8.0.x

@carlossanlop
Copy link
Contributor

Friendly reminder that Monday February 12th is the Code Complete deadline for the March Release. Please make sure to send the email to Tactics requesting approval.

@jeffschwMSFT jeffschwMSFT added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Feb 9, 2024
@jeffschwMSFT jeffschwMSFT added this to the 8.0.3 milestone Feb 9, 2024
@jeffschwMSFT jeffschwMSFT merged commit 6cd0edd into dotnet:release/8.0-staging Feb 9, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Mar 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-TypeSystem-coreclr Servicing-approved Approved for servicing release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants