Skip to content

[Repo Assist] test: add regression tests for false positive code fix scenarios (issues #1259, #1362)#1523

Draft
github-actions[bot] wants to merge 2 commits intomainfrom
repo-assist/test-redundant-qualifier-shadow-1259-341d2ca1921ee617
Draft

[Repo Assist] test: add regression tests for false positive code fix scenarios (issues #1259, #1362)#1523
github-actions[bot] wants to merge 2 commits intomainfrom
repo-assist/test-redundant-qualifier-shadow-1259-341d2ca1921ee617

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions bot commented Apr 7, 2026

🤖 This PR was created by Repo Assist, an automated AI assistant.

Summary

Adds two regression test cases as requested by the maintainer in issues #1259 and #1362, to verify these false positive code fix scenarios are no longer present.


Test 1: RemoveRedundantQualifier false positive when variable shadows property (issue #1259)

Scenario: When a local variable user shadows the Envelop.user property, FSAC was incorrectly offering the "Remove redundant qualifier" fix on envelop.user.Name.

Test: checkNotApplicable — verifies the fix is not offered for:

type User(name: string) =
  member val Name = name with get

type Envelop() =
  member val user = User("toto") with get

let test () =
  let user = User("user")
  let envelop = Envelop()
  if envelop.user.Name = "maxime" then
    printfn "It works"
  else
    printfn "It doesn't work"

If this test fails, the false positive is still present (the fix is still being offered when it shouldn't be). If it passes, the upstream FCS diagnostic is no longer incorrectly emitted for this scenario.


Test 2: RemoveUnnecessaryParentheses false positive in fluent method chain with decimal literal (issue #1362)

Scenario: bg.lighten(0.2).hexa () — FSAC was incorrectly offering to remove the parens around 0.2, which would produce invalid code bg.lighten 0.2.hexa ().

Test: checkNotApplicable — verifies the fix is not offered for bg.lighten((0.2)).hexa ().

The upstream fix landed in FCS 43.10.101 via dotnet/fsharp#18350. This test confirms the fix is in effect.


Test Status

  • ✅ Build: dotnet build test/FsAutoComplete.Tests.Lsp -f net8.0 — 0 errors
  • ✅ Format: dotnet fantomas --check — passes

Generated by 🌈 Repo Assist, see workflow run. Learn more.

Generated by 🌈 Repo Assist, see workflow run. Learn more.

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@7ee2b60744abf71b985bead4599640f165edcd93

github-actions bot and others added 2 commits April 7, 2026 04:30
…ier when variable shadows property (issue #1259)

This test verifies that FSAC/FCS does not incorrectly emit the 'This
qualifier is redundant' diagnostic when a local variable shadows a
member property with the same name. In the failing scenario, a local
binding 'user' should not cause 'envelop.user.Name' to be flagged as
having a redundant qualifier.

Closes #1259

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…in with decimal (issue #1362)

Adds a negative test case verifying that FSAC/FCS does not offer to
remove parentheses around a decimal literal (0.2) when used as an
argument in a fluent method chain (bg.lighten(0.2).hexa ()). The
upstream fix landed in FCS 43.10.101 via dotnet/fsharp#18350.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

1 participant