Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

where T : class, notnull error is confusing #45141

Closed
333fred opened this issue Jun 13, 2020 · 1 comment · Fixed by #45147
Closed

where T : class, notnull error is confusing #45141

333fred opened this issue Jun 13, 2020 · 1 comment · Fixed by #45147
Labels
Area-Compilers Concept-Diagnostic Clarity The issues deals with the ease of understanding of errors and warnings.

Comments

@333fred
Copy link
Member

333fred commented Jun 13, 2020

If you have where T: class, notnull, the error is that notnull must come first. If you have where T: notnull, class, the error is that class must come first. We should detect this situation and give a good error.

@333fred 333fred added Area-Compilers Concept-Diagnostic Clarity The issues deals with the ease of understanding of errors and warnings. labels Jun 13, 2020
@JakenVeina
Copy link

This is why I like you, Fred.

333fred added a commit to 333fred/roslyn that referenced this issue Jun 13, 2020
Instead of reporting that a constraint must come first, if there are multiple constraints that must come first, we now report that these constraints cannot be combined. We also suppress these errors if a previous error about inherited constraints was reported. Fixes dotnet#45141.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers Concept-Diagnostic Clarity The issues deals with the ease of understanding of errors and warnings.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants