E1102: module is both a file and a directory

View source

A module has exactly one root.

A module has exactly one root. It is a single file, src/shapes.act, or a directory with a canonical facade, src/shapes/shapes.act (ADR-0018). When both exist for one name, the compiler cannot tell which one the name means, so it rejects the module. The same error is reported for a child module that has a directory and a sibling file of the same name. The report is on the file that imports the module and has no line and column.

Example

actus
import shapes;

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

Fix

Keep one root. Here the single file is removed, and the directory module stays.

actus
import shapes;

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

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