scala/scala3

Warn when a pattern-bound variable shadows a regular variable

Open

#10 749 ouverte le 10 déc. 2020

Voir sur GitHub
 (5 commentaires) (2 réactions) (1 assigné)Scala (1 159 forks)batch import
area:pattern-matchingarea:reportingbackloghelp wanteditype:enhancement

Métriques du dépôt

Stars
 (6 247 stars)
Métriques de merge PR
 (Merge moyen 18j 14h) (133 PRs mergées en 30 j)

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).

Guide contributeur