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

贡献者指南