When I type the following code into Intellij, it highlights the x inside the match with the warning "Suspicious shadowing by a Variable Pattern"
val x = "some value"
"test" match {
case x =>
}
It suggests that I change it to:
val x = "some value"
"test" match {
case `x` => //note backticks
}
What is suspicious shadowing and what do the backticks do?!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…