Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UT for Variable Shadowing false positive #428

Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,25 @@ class VariableShadowingTest extends InspectionTest {
compileCodeSnippet(code)
compiler.scapegoat.feedback.warnings.size shouldBe 0
}
"when using Builder-pattern method chaining (#398)" in {
val code =
"""
|object Test {
|
| def f(x: Int): String = x.toString
| def g(y: String): Int = y.toInt
|
| val a = Seq(1, 2, 3)
| System.out.println(
| a
| .map(s => f(s))
| .map(s => g(s))
| )
|}
|""".stripMargin
compileCodeSnippet(code)
compiler.scapegoat.feedback.warnings.size shouldBe 0
}
}
}
}