E1001: binding declared twice in one scope

View source

A name can be declared only once in a scope.

A name can be declared only once in a scope. The function parameters and the top level of the verb body form one scope, so a local binding cannot reuse a parameter name either. The error points at the second declaration. To change a value, assign to the existing erg binding instead of declaring it again.

Example

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

Fix

Assign to the binding that already exists, or give the second binding a different name.

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

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