scala/scala3

Warn when a pattern-bound variable shadows a regular variable

Open

#10,749 建立於 2020年12月10日

在 GitHub 查看
 (5 留言) (2 反應) (1 負責人)Scala (1,159 fork)batch import
area:pattern-matchingarea:reportingbackloghelp wanteditype:enhancement

倉庫指標

Star
 (6,247 star)
PR 合併指標
 (平均合併 18天 14小時) (30 天內合併 133 個 PR)

描述

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

貢獻者指南