scala/scala3

Warn when a pattern-bound variable shadows a regular variable

Offen

#10.749 geöffnet am 10.12.2020

 (5 Kommentare) (2 Reaktionen) (1 zugewiesene Person)Scala (1.159 Forks)batch import
area:pattern-matchingarea:reportingbackloghelp wanteditype:enhancement

Repository-Metriken

Stars
 (6.247 Sterne)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

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