Skip to content

Commit c06be89

Browse files
committed
RedundantNewKeyword: added a test
That makes sure that the rule doesn't fire for for known type that implements IDisposable.
1 parent caa419b commit c06be89

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/FSharpLint.Core.Tests/Rules/Conventions/RedundantNewKeyword.fs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,12 @@ module Program =
116116
let foo = new SomeDisposableType() :> ISomeInterfaceWithDisposable"""
117117

118118
this.AssertNoWarnings()
119+
120+
[<Test>]
121+
member this.``New keyword is required for known type that implements IDisposable``() =
122+
this.Parse
123+
"""module Program
124+
125+
let foo = new System.Net.Http.HttpClient()"""
126+
127+
this.AssertNoWarnings()

0 commit comments

Comments
 (0)