Skip to content

CS0449 needs to be updated for 'unmanaged', 'notnull', and 'default' constraints #30785

@cremor

Description

@cremor

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.


Associated WorkItem - 476841

Metadata

Metadata

Labels

📌 seQUESTeredIdentifies that an issue has been imported into Quest.dotnet-csharp/svcerrors-warnings/subsvcin-prThis issue will be closed (fixed) by an active pull request.okr-qualityContent-quality KR: Concerns article defects (bugs), freshness, or build warnings.

Type

No type

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions