saveourtool/diktat

Shadowing of variables detection

Open

#425 aperta il 19 ott 2020

Vedi su GitHub
 (1 commento) (0 reazioni) (1 assegnatario)Kotlin (40 fork)github user discovery
enhancementgood first issuehelp wanted

Metriche repository

Star
 (571 star)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

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

Guida contributor