Skip to content

Commit 806fd67

Browse files
Copilotgewarren
andauthored
Document breaking change for Type.MakeGenericSignatureType argument validation in .NET 10 Preview 3 (#49124)
* Add breaking change documentation for Type.MakeGenericSignatureType argument validation Co-authored-by: gewarren <[email protected]> * Address review feedback: rename folder to 10, update issue number, and remove Preview 3 from New behavior section Co-authored-by: gewarren <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: gewarren <[email protected]>
1 parent 0767872 commit 806fd67

File tree

3 files changed

+51
-0
lines changed

3 files changed

+51
-0
lines changed

docs/core/compatibility/10.0.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ If you're migrating an app to .NET 10, the breaking changes listed here might af
5353
| [MacCatalyst version normalization](core-libraries/10.0/maccatalyst-version-normalization.md) | Behavioral change | Preview 1 |
5454
| [.NET runtime no longer provides default termination signal handlers](core-libraries/10.0/sigterm-signal-handler.md) | Behavioral change | Preview 5 |
5555
| [System.Linq.AsyncEnumerable included in core libraries](core-libraries/10.0/asyncenumerable.md) | Source incompatible | Preview 1 |
56+
| [Type.MakeGenericSignatureType argument validation](reflection/10/makegeneric-signaturetype-validation.md) | Behavioral change | Preview 3 |
5657
| [YMM embedded rounding removed from AVX10.2](core-libraries/10.0/ymm-embedded-rounding.md) | Behavioral change | Preview 5 |
5758

5859
## Cryptography
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
title: "Breaking change: Type.MakeGenericSignatureType argument validation"
3+
description: Learn about the .NET 10 breaking change in core .NET libraries where Type.MakeGenericSignatureType validates that the genericTypeDefinition argument is a generic type definition.
4+
ms.date: 10/13/2025
5+
ai-usage: ai-assisted
6+
ms.custom: https://github.com/dotnet/docs/issues/48902
7+
---
8+
# Type.MakeGenericSignatureType argument validation
9+
10+
Starting in .NET 10, the <xref:System.Type.MakeGenericSignatureType(System.Type,System.Type[])?displayProperty=nameWithType> API validates that the `genericTypeDefinition` argument is a generic type definition.
11+
12+
## Version introduced
13+
14+
.NET 10 Preview 3
15+
16+
## Previous behavior
17+
18+
Previously, <xref:System.Type.MakeGenericSignatureType(System.Type,System.Type[])?displayProperty=nameWithType> accepted any type for the `genericTypeDefinition` argument, including non-generic types.
19+
20+
## New behavior
21+
22+
Starting in .NET 10, <xref:System.Type.MakeGenericSignatureType(System.Type,System.Type[])?displayProperty=nameWithType> requires the `genericTypeDefinition` argument to be a generic type definition. If the argument is not a generic type definition, the method throws an <xref:System.ArgumentException>.
23+
24+
## Type of breaking change
25+
26+
This change is a [behavioral change](../../categories.md#behavioral-change).
27+
28+
## Reason for change
29+
30+
The type created by <xref:System.Type.MakeGenericSignatureType(System.Type,System.Type[])?displayProperty=nameWithType> had non-sensical behavior when the `genericTypeDefinition` argument was not a generic type definition.
31+
32+
## Recommended action
33+
34+
Avoid calling <xref:System.Type.MakeGenericSignatureType(System.Type,System.Type[])?displayProperty=nameWithType> for types that are not generic type definitions. For example:
35+
36+
```csharp
37+
// Before
38+
Type instantiatedType = Type.MakeGenericSignatureType(originalType, instantiation);
39+
40+
// After
41+
Type instantiatedType = originalType.IsGenericTypeDefinition ? Type.MakeGenericSignatureType(originalType, instantiation) : originalType;
42+
```
43+
44+
## Affected APIs
45+
46+
- <xref:System.Type.MakeGenericSignatureType(System.Type,System.Type[])?displayProperty=fullName>

docs/core/compatibility/toc.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ items:
110110
href: networking/10.0/default-http-streaming.md
111111
- name: "'Uri' length limits removed"
112112
href: networking/10.0/uri-length-limits-removed.md
113+
- name: Reflection
114+
items:
115+
- name: Type.MakeGenericSignatureType argument validation
116+
href: reflection/10/makegeneric-signaturetype-validation.md
113117
- name: SDK and MSBuild
114118
items:
115119
- name: .NET CLI `--interactive` defaults to `true` in user scenarios

0 commit comments

Comments
 (0)