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

"error CS9027: Unexpected keyword 'unchecked'" is reported for cref syntax #69142

Closed
AlekseyTs opened this issue Jul 21, 2023 · 0 comments · Fixed by #69609
Closed

"error CS9027: Unexpected keyword 'unchecked'" is reported for cref syntax #69142

AlekseyTs opened this issue Jul 21, 2023 · 0 comments · Fixed by #69609
Assignees
Labels
4 - In Review A fix for the issue is submitted for review. Area-Compilers Bug
Milestone

Comments

@AlekseyTs
Copy link
Contributor

        [Fact, WorkItem(60394, "https://github.com/dotnet/roslyn/issues/60394")]
        public void UnqualifiedOperatorMember1_Unchecked()
        {
            UsingNode("operator unchecked +", TestOptions.RegularWithDocumentationComments,
                // (1,16): warning CS1584: XML comment has syntactically incorrect cref attribute 'operator unchecked +'
                // /// <see cref="operator unchecked +"/>
                Diagnostic(ErrorCode.WRN_BadXMLRefSyntax, "operator unchecked +").WithArguments("operator unchecked +").WithLocation(1, 16),
                // (1,25): error CS9027: Unexpected keyword 'unchecked'
                // /// <see cref="operator unchecked +"/>
                Diagnostic(ErrorCode.ERR_MisplacedUnchecked, "unchecked").WithLocation(1, 25));

            N(SyntaxKind.OperatorMemberCref);
            {
                N(SyntaxKind.OperatorKeyword);
                N(SyntaxKind.PlusToken);
            }
            EOF();
        }

Expected: A warning. I think we never report errors for doc comments.

Introduced in #61309.

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Issues and PRs which have not yet been triaged by a lead label Jul 21, 2023
@jcouv jcouv self-assigned this Jul 26, 2023
@jcouv jcouv added the Bug label Jul 26, 2023
@jcouv jcouv added this to the 17.9 milestone Jul 26, 2023
@jcouv jcouv removed the untriaged Issues and PRs which have not yet been triaged by a lead label Jul 26, 2023
@jcouv jcouv added the 4 - In Review A fix for the issue is submitted for review. label Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4 - In Review A fix for the issue is submitted for review. Area-Compilers Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants