scala/scala3

Warn when a pattern-bound variable shadows a regular variable

Open

#10.749 aperta il 10 dic 2020

Vedi su GitHub
 (5 commenti) (2 reazioni) (1 assegnatario)Scala (1159 fork)batch import
area:pattern-matchingarea:reportingbackloghelp wanteditype:enhancement

Metriche repository

Star
 (6247 star)
Metriche merge PR
 (Merge medio 18g 14h) (133 PR mergiate in 30 g)

Descrizione

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

Guida contributor