I feel like this is a silly question, but I'll ask anyway... I'm trying to do something like this:
def func(x: Int, y: Int) = {
val value: Int = 0 //from config
(x, y) match {
case (value, value) => "foo"
case _ => "bar"
}
}
But both the repl and intelliJ shower me with warnings. (e.g. "patterns after a variable pattern cannot match"; "suspicious shadowing by a variable pattern"; etc.). Is there a correct way to match on non-literal values?