fsprojects / fsprojects/FSharpLint
FL0034: False positive with C# Action<XXX>
Open
Nobody has claimed this yet.
- Dominant language
- F#
- Stars
- 327
- Forks
- 74
- PR merge metrics
- No merged PRs in 30d
Description
Description
Call a C# method expecting a parameter of type Action<XXX> with a fsharp fun and you will get the false-positive.
Repro steps
For example, when using Python.Included, do:
Installer.add_LogMessage (fun x -> Log.Debug x) // FL0034
//Installer.add_LogMessage (Log.Debug) // Code is invalid
Expected behavior
No issue reported as call-site doesn't allow such code.
Actual behavior
Warning raised.
Known workarounds
Not aware of any workaround.
Related information
- Operating system: Win10
- Branch: VS extension
- .NET Runtime: 4.8
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source file or test entry point is identified. Start by reproducing the Python.Included call on the VS extension branch with .NET 4.8, then trace the diagnostic for the F# function passed to C# Action. Done means the valid call no longer raises FL0034.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, fsharp
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100