diktat icon indicating copy to clipboard operation
diktat copied to clipboard

Shadowing of variables detection

Open orchestr7 opened this issue 5 years ago • 1 comments

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++
        }
}

orchestr7 avatar Oct 19 '20 06:10 orchestr7

#426 should help to create the logic next time

orchestr7 avatar Sep 13 '21 08:09 orchestr7