E1114: configuration module has a runtime declaration

View source

A configuration module holds values that are fixed at compile time.

A configuration module holds values that are fixed at compile time. A verb, an external verb, a role or a perform is code that runs, so it does not belong there (ADR-0054). Constants, structs, enums, packs and open lines are allowed. The error points at the declaration, and the message names its kind.

Example

actus
import config;

verb main() {
    erg limit = config::LIMIT;
}
actus
open values;
actus
open const LIMIT: u8 = 30u8;

open verb runtime_state() -> Int {
    return 1;
}

Fix

Keep only compile-time declarations in config. Put the verb in an ordinary module.

actus
import config;

verb main() {
    erg limit = config::LIMIT;
}
actus
open values;
actus
open const LIMIT: u8 = 30u8;

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