rokucommunity / bslint

A linter for BrightScript and BrighterScript.
MIT License
28 stars 14 forks source link

Fasle positive LINT1005 #16

Closed timalacey closed 3 years ago

timalacey commented 3 years ago
  teamAColorFound = false
  teamBColorFound = false
  for i = 0 to teamColors.count() - 1
    if teamColors[i].id = "A"
      teamAColorFound = true
      if teamBColorFound
        exit for
      end if
    else if teamColors[i].id = "B"
      teamBColorFound = true
      if teamAColorFound
        exit for
      end if
    end if
  end for

teamBColorFound = true fires Variable 'teamBColorFound' is set but value is never used brs(LINT1005) presumably because it is used a few lines above in the for loop.

elsassph commented 3 years ago

You don't use teamAColorFound and teamBColorFound after the loop?