E1115: import name is already bound

View source

An import binds a name in the file: the last segment of the path, or the name after as.

An import binds a name in the file: the last segment of the path, or the name after as. The same name cannot be bound twice in one file, even when both imports name the same path (ADR-0087). Two different paths cannot share a final segment either, unless one of them is renamed with as. ADR-0110 sets the same rule for imports of modules that belong to one unit. The error points at the second import and shows the first one as a related location.

Example

actus
import left::cache;
import right::cache;

verb main() {
}
actus
open cache;
actus
open items;
actus
open verb left_size() -> Int {
    return 1;
}
actus
open cache;
actus
open items;
actus
open verb right_size() -> Int {
    return 2;
}

Fix

Give each import its own name with as.

actus
import left::cache as left_cache;
import right::cache as right_cache;

verb main() {
    erg size = left_cache::left_size();
}
actus
open cache;
actus
open items;
actus
open verb left_size() -> Int {
    return 1;
}
actus
open cache;
actus
open items;
actus
open verb right_size() -> Int {
    return 2;
}

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