You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
List(("first", "second"))
.map { case (_, _) =>for {
a <-Some("a")
b = a // b is not used warning
} yield b
}
Problem
When using a pattern match anonymous function in a HOF, variables assigned inside
a for-comprehension(b = a) are reported as unused.
Same snippet in 2.13.14 works fine.
Explain how the above behavior isn't what you expected.
Do not report it as unused since it clearly is used
Workaround
List(("first", "second"))
.map { a =>
a match {
case (_, _) =>
for {
a <- Some("a")
b = a
} yield b
}
}