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

More user-friendly error when writing unchecked to declare an unchecked user-defined operator #61305

Closed
Rekkonnect opened this issue May 13, 2022 · 3 comments
Labels
Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead

Comments

@Rekkonnect
Copy link
Contributor

Rekkonnect commented May 13, 2022

Just tried the checked user-defined operator feature out, and I think it would be nice to have a more specific error when a user types:

public static int operator unchecked +(int left, int right);
//                         ~~~~~~~~~

Saying that unchecked operators do not require the modifier. Currently, multiple unrelated errors are being shown, and parsing breaks miserably:
image

Originally posted here

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels May 13, 2022
@jcouv
Copy link
Member

jcouv commented May 13, 2022

That'll definitely be better.
Closing as duplicate of #60394

@jcouv jcouv closed this as completed May 13, 2022
@Rekkonnect
Copy link
Contributor Author

By the way, shouldn't this be added to the test plan for this feature? That's where I looked for to find whether the issue is known.

@jcouv
Copy link
Member

jcouv commented May 13, 2022

@alfasgd Added link in test plan. Working on a fix now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

No branches or pull requests

2 participants