Skip to content

/// comments on the same line as a DU case apply to the next case #18843

@michaelwinch

Description

@michaelwinch

If you add a triple slash comment /// on the same line after a DU case, it will add the information to the next case.
Edit: I've just also noticed this happens on records too

Repro steps

Image

Expected behavior

I would expect it to either add it to the case that it's on the same line as, or ignore it completely

Actual behavior

It adds the comment to the case after

Known workarounds

Move it to it's own line before the case

Related information

This happens on Rider and VSCode (latest)
.NET 8

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-Compiler-Syntaxlexfilter, indentation and parsingBugImpact-Medium(Internal MS Team use only) Describes an issue with moderate impact on existing code.

    Type

    Projects

    Status

    New

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions