Skip to content

[Repo Assist] test: add test case for FSAC0002 false positive in nullable join clause (issue #824)#1484

Draft
github-actions[bot] wants to merge 4 commits intomainfrom
repo-assist/test-issue-824-fsac0002-nullable-join-732eb95abb8646ac
Draft

[Repo Assist] test: add test case for FSAC0002 false positive in nullable join clause (issue #824)#1484
github-actions[bot] wants to merge 4 commits intomainfrom
repo-assist/test-issue-824-fsac0002-nullable-join-732eb95abb8646ac

Conversation

@github-actions
Copy link
Contributor

🤖 This is an automated PR from Repo Assist.

Summary

Adds a test case documenting the false positive FSAC0002 diagnostic that occurs when using the nullable join operator (=?) in a query expression (issue #824).

Problem

When writing a query expression like:

query {
  for row1 in table1 do
  join row2 in table2 on (row1.Column1 =? row2.Column2)
  select (row1, row2)
}

FSAC incorrectly reports row1 as a redundant qualifier (FSAC0002). The "Remove redundant qualifier" code fix appears, but applying it would break the code since row1 is necessary in this context.

Root Cause

This is an upstream bug in FCS: FSharp.Compiler.EditorServices.SimplifyNames.getSimplifiableNames incorrectly returns row1.Column1 as simplifiable in a nullable join clause. FSAC simply reports what FCS tells it, so the fix needs to happen upstream.

Change

Added a test case using itestCaseAsync (ignored — does not run, does not fail CI) to the RemoveRedundantQualifier test list. This approach is appropriate per the project convention:

Used to mark issues & shortcomings in CodeFixes, but without any (immediate) intention to fix (vs. pending → marked for fixing)

When the upstream FCS bug is fixed, itestCaseAsync should be changed to testCaseAsync to activate the regression test.

Test Status

Build: dotnet build test/FsAutoComplete.Tests.Lsp/FsAutoComplete.Tests.Lsp.fsproj -f net8.0 — succeeded (0 warnings, 0 errors)
Format: dotnet fantomas — file was unchanged
ℹ️ The new test itself is ignored (itestCaseAsync) so it does not run; it serves as documentation of the expected behavior.

Closes #824

Generated by Repo Assist for issue #824

To install this agentic workflow, run

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

…oin (issue #824)

The FCS SimplifyNames.getSimplifiableNames incorrectly marks row1 as
a redundant qualifier when using the nullable join operator (=?) in a
query expression. The identifier is actually required and removing it
would break the code.

This test documents the expected behavior (fix should NOT be offered).
It uses itestCaseAsync because the bug is upstream in FCS and has no
immediate fix in FSAC. When FCS is fixed, change itestCaseAsync to
testCaseAsync.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Krzysztof-Cieslak
Copy link
Member

/repo-assist unignore the test, we want to check if it's passing

Change itestCaseAsync to testCaseAsync to activate the regression test
and check if the upstream FCS bug has been fixed.

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

Commit pushed: 667c435

Generated by Repo Assist

@github-actions
Copy link
Contributor Author

🤖 This is an automated response from Repo Assist.

Done! I've changed itestCaseAsynctestCaseAsync for the "doesn't remove necessary qualifier in nullable join clause (issue #824)" test. CI will now run it and we'll see whether it passes (meaning the upstream FCS bug is fixed) or fails (meaning it still needs to be fixed upstream).

Generated by Repo Assist for issue #1484

To install this agentic workflow, run

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

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.

FSAC0002 incorrectly tagged on nullable join clause in query expression

1 participant