Code unreachable?

I have another question. This is more out of curiosity.
I have this function, and it throws a warning that the i++ is “unreachable code”. It compiles, so it’s not really a problem. But why?

function checkOwner(address _address) private view returns(bool _bool) {
        for (uint i=0; i<owners.length; i++) {
            if (owners[i] == _address) {
                return true;
            } else {
                return false;
            }
        }
    }
1 Like

Try to delete the keyword _bool, you are not specifying when its being returned.

Else, should be great if you provide the entire contract to debug it.

Carlos Z