scala/scala3

Warn when a pattern-bound variable shadows a regular variable

オープン

#10,749 opened on 2020/12/10

 (5 件のコメント) (2 件のリアクション) (1 人の担当者)Scala (1,159 件のフォーク)batch import
area:pattern-matchingarea:reportingbackloghelp wanteditype:enhancement

Repository metrics

Stars
 (6,247 個のスター)
PR merge metrics
 (平均マージ 18d 14h) (30d で 133 merged PRs)

説明

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

コントリビューターガイド