E1002: binding hides one from an enclosing scope

View source

A binding in a nested block cannot reuse the name of a binding that is still visible from an enclosing scope.

A binding in a nested block cannot reuse the name of a binding that is still visible from an enclosing scope. Actus has no shadowing, so a name always means the same value wherever it is visible. The error points at the inner declaration. A name that repeats in the same scope is reported as E1001 instead.

Example

actus
verb main() {
    erg total: Int = 1;
    {
        erg total: Int = 2;
    }
}

Fix

Give the inner binding its own name.

actus
verb main() {
    erg total: Int = 1;
    {
        erg partial: Int = 2;
    }
}

Run actus explain E1002 in your terminal to read this entry offline. Browse Ownership & types or all error codes.