Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small issue in documenting "variable-scope" detector #2245

Closed
mojtaba-eshghie opened this issue Nov 27, 2023 · 4 comments · Fixed by #2258
Closed

Small issue in documenting "variable-scope" detector #2245

mojtaba-eshghie opened this issue Nov 27, 2023 · 4 comments · Fixed by #2258
Labels
good first issue Good for newcomers

Comments

@mojtaba-eshghie
Copy link

In the following part of the documentation, in the comment, z is said to be used before declaration. Whereas the x is used pre-declaration.
Link to the part of documentation concerning this issue

contract C {
    function f(uint z) public returns (uint) {
        uint y = x + 9 + z; // 'z' is used pre-declaration
        uint x = 7;

        if (z % 2 == 0) {
            uint max = 5;
            // ...
        }

        // 'max' was intended to be 5, but it was mistakenly declared in a scope and not assigned (so it is zero).
        for (uint i = 0; i < max; i++) {
            x += 1;
        }

        return x;
    }
}
@0xalpharush 0xalpharush added the good first issue Good for newcomers label Nov 28, 2023
@ATREAY
Copy link
Contributor

ATREAY commented Dec 2, 2023

Hey @0xalpharush, is it okay if I work on this issue if it's still available?

@0xalpharush
Copy link
Contributor

@ATREAY Go for it!

@ATREAY
Copy link
Contributor

ATREAY commented Dec 7, 2023

Hi @0xalpharush, I've made the necessary changes. Could you please take a look when you have a moment?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants