Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/FSharpLint.Core/fsharplint.json
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,6 @@
"false <> a ===> a",
"if a then true else false ===> a",
"if a then false else true ===> not a",
"if x then y else y ===> y",
"not (not x) ===> x",

"(fst x, snd x) ===> x",
Expand Down
28 changes: 28 additions & 0 deletions tests/FSharpLint.Core.Tests/Rules/Hints/HintMatcher.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1017,3 +1017,31 @@ let foo =
"""

Assert.That this.NoErrorsExist

[<Test>]
[<Ignore("Fixing it would take a lot of work since AbstractSyntaxArray.getHashCode function would have to be defined for all expression types.")>]
member this.``Records with different data (not a literal constant) should be treated as diffrerent``() =
this.SetConfig(["if x then y else y ===> y"])

this.Parse """
type Foo =
| Bar
| Baz

type Record =
{
Foo: Foo
}

let foo =
if 2 = 2 then
{
Foo = Bar
}
else
{
Foo = Baz
}
"""

Assert.That this.NoErrorsExist
Loading