scala/scala3

Warn when a pattern-bound variable shadows a regular variable

Open

#10,749 opened on Dec 10, 2020

View on GitHub
 (5 comments) (2 reactions) (1 assignee)Scala (6,247 stars) (1,159 forks)batch import
area:pattern-matchingarea:reportingbackloghelp wanteditype:enhancement

Description

If someone writes:

object Test {
  def foo[T](x: Int, y: Int) = x match {
    case y => y
  }
}

It means they forgot backticks and actually wanted to write case `y` => y, we should warn them about it (same with pattern-bound type variables).

Contributor guide