E1106: duplicate declaration in a module

View source

All .act files that sit directly in one module directory share one scope.

All .act files that sit directly in one module directory share one scope. A name may be declared only once in it, so a verb, struct, enum, role or constant that appears in two files of the module is an error (ADR-0018). The error points at the second declaration, and the message names both files. Across modules, ADR-0110 keeps declaration names unique within one program.

Example

actus
import shapes;

verb main() {
}
actus
open circle;
open square;
actus
open verb area() -> Int {
    return 1;
}
actus
open verb area() -> Int {
    return 2;
}

Fix

Give each declaration its own name. If the two declarations are the same thing, keep one of them.

actus
import shapes;

verb main() {
}
actus
open circle;
open square;
actus
open verb circle_area() -> Int {
    return 1;
}
actus
open verb square_area() -> Int {
    return 2;
}

Run actus explain E1106 in your terminal to read this entry offline. Browse Modules & rules or all error codes.