fsprojects / fsprojects/FSharpLint
Hint "x = true ===> x" is triggered by simple object creation or optional arguments
Open
Nobody has claimed this yet.
bug
- Dominant language
- F#
- Stars
- 327
- Forks
- 74
- PR merge metrics
- No merged PRs in 30d
Description
Description
Tool is reporting error (FL0065): Hints x = truemight be able to be refactored intox. for the simple object creation process or optional arguments
Repro steps
Optional argument:
Http.AsyncRequest("someSite", silentHttpErrors = true) |> Async.RunSynchronously- ->
(FL0065): Hints - Error:x = truemight be able to be refactored intox. on the (48 - 48)
Object initialization:
- Given C# class:
public class MySimpleType
{
public int SimpleInt { get;set;}
public bool SuperBoolProperty { get; set; }
public string SimpleString { get;set;}
}
- And initialize it in F#
let giveObject () =
MySimpleType(
SimpleInt = 12,
SuperBoolProperty = true,
SimpleString = "String")
- ->
(FL0065): Hints - Error:x = truemight be able to be refactored intox. on the (20- 20)
Expected behavior
Should be no error
Actual behavior
Tool reports error
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 FL0065 with the optional-argument and simple-object-initialization examples from the issue, then locate the rule that emits this diagnostic. Confirm that both cases no longer produce the warning while other intended x = true suggestions remain unaffected.
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
- Mostly clear
- Newbie friendliness
- 35/100