fsprojects / fsprojects/FSharpLint
Lint suggests "not (isNull x)" over "x <> null"
Nobody has claimed this yet.
- Dominant language
- F#
- Stars
- 327
- Forks
- 74
- PR merge metrics
- No merged PRs in 30d
Description
Description
The linter suggests replacing a null check (x <> null) with the more complicated not (isNull x). I'm not coming up with any cases where I think a null check would be better as not (isNull x).

Repro steps
Please provide the steps required to reproduce the problem
-
Add a
<> nullcheck to your F# code -
View linter error
Expected behavior
The linter doesn't warn on <> null checks.
Actual behavior
The linter warns on <> null checks.
Known workarounds
Disable the linter.
Related information
- Operating system
- Branch
- .NET Runtime, CoreCLR or Mono Version
- Performance information, links to performance testing scripts
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
Reproduce the warning by adding an x <> null check to F# code, then locate the lint rule that reports it. Done means the linter no longer warns for this check and the behavior is covered by the relevant rule tests, if present.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- fsharp
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100