dotnet / dotnet/fsharp

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

Open
#18,843 5 comments 1 reaction 0 assignees View on GitHub
Area-Compiler-Syntax Bug Impact-Medium
Dominant language
F#
Stars
4.3k
Forks
876
Avg merge
4d 11h
Merged PRs (30d)
131

Description

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.