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

Consider gracefully recovering from erroneous use of 'unchecked' in operator declaration #60394

Closed
AlekseyTs opened this issue Mar 25, 2022 · 0 comments · Fixed by #61309
Closed

Comments

@AlekseyTs
Copy link
Contributor

AlekseyTs commented Mar 25, 2022

class C0 
{
    public static C0 operator unchecked -(C0 x)
    {
        return x;
    }
    public static C0 operator unchecked -(C0 x, C0 y)
    {
        return x;
    }
    public static explicit operator unchecked long(C0 x)
    {
        return 0;
    }
}

Only checked keyword is allowed at that position.

Relates to test plan #59458

@AlekseyTs AlekseyTs self-assigned this Mar 25, 2022
@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Issues and PRs which have not yet been triaged by a lead label Mar 25, 2022
@jcouv jcouv added this to the C# 11.0 milestone Mar 28, 2022
@jcouv jcouv removed the untriaged Issues and PRs which have not yet been triaged by a lead label Mar 28, 2022
@jcouv jcouv assigned jcouv and unassigned AlekseyTs May 13, 2022
@jcouv jcouv modified the milestones: C# 11.0, 17.3 May 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants