-
Notifications
You must be signed in to change notification settings - Fork 6k
Open
Labels
🗺️ reQUESTTriggers an issue to be imported into Quest.Triggers an issue to be imported into Quest.breaking-changeIndicates a .NET Core breaking changeIndicates a .NET Core breaking change
Description
Description
Starting in .NET 10 Preview 3, Type.MakeGenericSignatureType
API validates that the genericTypeDefinition
argument is in fact a generic type definition.
Version
.NET 10 Preview 3
Previous behavior
Type.MakeGenericSignatureType
accepted any type for the genericTypeDefinition
argument.
New behavior
Type.MakeGenericSignatureType
requires genericTypeDefinition
argument to be a generic type definition and throws ArgumentException otherwise.
Type of breaking change
- Behavioral change: Existing binaries might behave differently at runtime.
Reason for change
The type created by Type.MakeGenericSignatureType
had non-sensical behavior when the genericTypeDefinition
argument was not a generic type definition.
Recommended action
Avoid calling Type.MakeGenericSignatureType
for types that are not generic type definitions. For example:
// Before
Type instantiatedType = Type.MakeGenericSignatureType(originalType, instantiation);
// After
Type instantiatedType = originalType.IsGenericTypeDefinition ? Type.MakeGenericSignatureType(originalType, instantiation) : originalType;
Affected APIs
System.Type.MakeGenericSignatureType
Metadata
Metadata
Assignees
Labels
🗺️ reQUESTTriggers an issue to be imported into Quest.Triggers an issue to be imported into Quest.breaking-changeIndicates a .NET Core breaking changeIndicates a .NET Core breaking change
Type
Projects
Status
🔖 Ready