Skip to content

Commit 3a608c6

Browse files
committed
Core(Tests): new test for DisallowShadowing
That makes sure that there is no false positive when different non-nested functions have the same parameter name.
1 parent e38d26e commit 3a608c6

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,17 @@ let foo = 1"""
138138

139139
Assert.IsTrue this.NoErrorsExist
140140

141+
[<Test>]
142+
member this.``Should not produce error when parameter with same name exists in another function``() =
143+
this.Parse """
144+
let foo target =
145+
target
146+
147+
let bar target =
148+
target + 1"""
149+
150+
Assert.IsTrue this.NoErrorsExist
151+
141152
[<Test>]
142153
member this.``Should not produce error when variable name starts with underscore``() =
143154
this.Parse """

0 commit comments

Comments
 (0)