scala/scala3

Warn when a pattern-bound variable shadows a regular variable

Open

#10,749 opened on 2020年12月10日

GitHub で見る
 (5 comments) (2 reactions) (1 assignee)Scala (1,159 forks)batch import
area:pattern-matchingarea:reportingbackloghelp wanteditype:enhancement

Repository metrics

Stars
 (6,247 stars)
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).

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