FL0035: False positive with Active Patterns

Open
#484 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
fsharp
Domain
tooling

Research direction

No source file or test is named. Start by locating the FL0035 rule and reproducing the provided active-pattern example in F# Lint 0.5.2; compare it with a case where the rule should apply. Done means the example no longer produces an FL0035 diagnostic and regression coverage verifies that behavior.

Written by the indexing model from the issue text.

Description

Description

Composition cannot be applied (or I couldn't figure out how to) for Active Patterns so FL0035 should not be raised.

Repro steps
let (|Something|_|) (l: int list option) =
	l |> Option.map (fun x -> Something (System.Collections.ObjectModel.ObservableCollection x)) // FL0035 FP
Expected behavior

No issue raised.

Actual behavior

FL0035 is raised.

Known workarounds

Don't know.

Related information
  • Operating system: Windows 10
  • Branch: F# Lint 0.5.2
  • .NET Runtime, CoreCLR or Mono Version: .net 48
Dominant language
F#
Stars
327
Forks
74
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from fsprojects/FSharpLint

All issues in fsprojects/FSharpLint

Similar issues

More DevTools issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.