Skip to content

[Repo Assist] Add regression test for match on long anonymous record discriminant, 1903#3296

Merged
nojaf merged 3 commits intomainfrom
repo-assist/regression-test-1903-match-anon-record-indentation-044a592e512dc5ef
Mar 18, 2026
Merged

[Repo Assist] Add regression test for match on long anonymous record discriminant, 1903#3296
nojaf merged 3 commits intomainfrom
repo-assist/regression-test-1903-match-anon-record-indentation-044a592e512dc5ef

Conversation

@github-actions
Copy link
Contributor

🤖 This is an automated pull request from Repo Assist, an AI assistant.

Closes #1903

Summary

Issue #1903 reported that formatting a match expression with a long anonymous record type in the discriminant (using unbox<{| ... |}>) caused an indentation warning on the line inside the parentheses. This was filed against Fantomas 4.6 with MaxLineLength = 60.

nojaf confirmed on 2026-02-24 that this is no longer a problem in the current version, and requested a regression test so the issue can be closed.

What This PR Does

Adds a regression test to PatternMatchingTests.fs that:

  1. Formats a match expression with a long nested anonymous record type as the discriminant (using unbox) with MaxLineLength = 60
  2. Verifies the output is the expected, correctly-indented form (no indentation warning on source')
  3. Confirms idempotency (the output is stable under re-formatting)

Test Status

  • ✅ Build succeeded (0 errors)
  • ✅ All 2739 tests pass (2738 existing + 1 new regression test)
  • ✅ New test passes with correct output
  • ✅ Source formatted with dotnet fantomas

Generated by Repo Assist ·

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@346204513ecfa08b81566450d7d599556807389f

Generated by Repo Assist ·

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@346204513ecfa08b81566450d7d599556807389f

Verifies that formatting a match expression with a long anonymous record
type in the discriminant no longer causes indentation warnings.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@nojaf
Copy link
Contributor

nojaf commented Mar 17, 2026

/repo-assist add changelog entry

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Contributor Author

Commit pushed: 1e46d1d

Generated by Repo Assist

@nojaf
Copy link
Contributor

nojaf commented Mar 17, 2026

/repo-assist always add your item last in the section, so weird that you shoved this in mid section

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Contributor Author

Commit pushed: 129575c

Generated by Repo Assist

@nojaf nojaf closed this Mar 17, 2026
@nojaf nojaf reopened this Mar 17, 2026
@nojaf nojaf marked this pull request as ready for review March 17, 2026 07:52
@nojaf nojaf merged commit 82f5bab into main Mar 18, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Indentation warning for long match expression with anonymous record

1 participant