scala/scala3
在 GitHub 查看Warn when a pattern-bound variable shadows a regular variable
Open
#10,749 建立於 2020年12月10日
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).