Skip to content

Commit e3827a8

Browse files
committed
tests/RedundantNewKeyword: new 'let' testcase
Unlike with `use`, in case of `let` binding, usage of `new` on unresolved type should fire the rule.
1 parent abbf5fa commit e3827a8

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,14 @@ module Program
8686

8787
Assert.IsFalse this.ErrorsExist
8888

89+
[<Test>]
90+
member this.``unresolved type with 'let' should give rule violations``() =
91+
this.Parse """
92+
module Program
93+
let SomeFunc() =
94+
let foo = new UnresolvedType()
95+
foo.Foo
96+
"""
97+
98+
Assert.IsTrue this.ErrorsExist
99+

0 commit comments

Comments
 (0)