-
Notifications
You must be signed in to change notification settings - Fork 6k
Description
This documentation page only mentions the 'class' and 'struct' constraint. But the current (VS 17.3) error message contains more:
The 'class', 'struct', 'unmanaged', 'notnull', and 'default' constraints cannot be combined or duplicated, and must be specified first in the constraints list.
This page should be updated to contain all of them.
In my case, I was looking for a reason why I can't combine class
and notnull
constraints. I had to find the generic type constraint documentation page to find the reason (class
already implies notnull
in a nullable context). Maybe that special case could be mentioned here. But at least the documentation page should be linked.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: db2c4fd8-bf61-f438-df47-9659bde6232f
- Version Independent ID: c0fc18fb-3cfb-2d54-640e-7872695b9f2d
- Content: Compiler Error CS0449
- Content Source: docs/csharp/misc/cs0449.md
- Product: dotnet-csharp
- Technology: csharp-diagnostics
- GitHub Login: @BillWagner
- Microsoft Alias: wiwagn
Metadata
Metadata
Assignees
Labels
Type
Projects
Status