saveourtool/diktat

Shadowing of variables detection

開放

#425 建立於 2020年10月19日

 (1 則留言) (0 個反應) (1 位負責人)Kotlin (40 個分叉)github user discovery
enhancementgood first issuehelp wanted

倉庫指標

星標
 (571 顆星)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

Diktat should be able to detect shadowed variables as it can cause serious issues.

Name shadowing can cause following issues. There should be no shadowing.
infinite loop:

fun main() {
        var x = 0
        while (x < 10) {
            var x = 0
            x++
        }
}

貢獻者指南