FuelLabs / sway

🌴 Empowering everyone to build reliable and efficient smart contracts.

Home Page:https://fuellabs.github.io/sway

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wrong "This declaration is never used." warning when variables are used only in reassignment LHS in index expressions

ironcev opened this issue · comments

E.g., this example will emit a false warning:

script;

fn main() {
    let i = 0;
    //  - This declaration is never used.  <<<----- WRONG WARNING.
    let mut array = [1, 2, 3];

    array[i] = 0; // <<<----- `i` is used here.
}