Closed
Description
import scala.util.matching.Regex
object Test {
def main(args: Array[String]): Unit = {
foo("c" :: Nil, false)
}
def foo(remaining: List[String], inCodeBlock: Boolean): Unit = {
remaining match {
case CodeBlockEndRegex(before) :: ls =>
case SymbolTagRegex(name) :: ls if !inCodeBlock => println("OK")
case _ =>
}
}
val CodeBlockEndRegex = new Regex("(b)")
val SymbolTagRegex = new Regex("(c)")
}
Emits the folowing warining but should not.
11 | case SymbolTagRegex(name) :: ls if !inCodeBlock => println("OK")
| ^^^^^^^^^^^^^^^^
| unreachable code
The code is correctly compiled and executed.