False positive for unused value in for comprehension
leifwickland opened this issue · 2 comments
leifwickland commented
I'm not exactly sure of the minimal case for this one, but a value in a for comprehension which is filtered and/or passed passed to a function but not directly yielded is incorrectly reported as unused
final object StringUtils {
val b = for {
i <- 1 to 5
if i % 2 == 0
a = f(i) * 2
} yield a
}
The error message is:
warning: value i is not used.
i <- 1 to 5
^
(Apologies if this doesn't produce a reproducible test case. I'm attempting to replicate an example from a closed code base. If you struggle to produce the reported error, I'd be happy to attempt to offer a better example.)
dragos commented
I think it has the same root as #47... We should find a way to "merge" uses of different symbols that correspond to the same source entity.
SethTisue commented
Abide is superseded by https://github.com/scalacenter/scalafix; closing all issues