FSharpLint
FSharpLint copied to clipboard
Hint "x = true ===> x" is triggered by simple object creation or optional arguments
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
Actually same happens for the Hint "x = null ===> isNull x",
Just modify:
let giveObject () =
MySimpleType(
SimpleInt = 12,
SuperBoolProperty = true,
SimpleString = null)
I am also facing the same issue for both true and false cases on property initialization in the ctor declaration.