E1129: realtime code calls itself without a bound

View source

A verb marked meta realtime may not call itself directly unless the depth of the recursion has a static bound (ADR-0094).

A verb marked meta realtime may not call itself directly unless the depth of the recursion has a static bound (ADR-0094). The compiler cannot prove that an unbounded recursion ends in time, and it can run out of stack. The error points at the recursive call.

Example

actus
meta realtime
verb count_down(erg n: Int) -> Int {
    return count_down(n: erg n);
}

verb main() {
}

Fix

Write the repetition as a loop with fixed ends.

actus
meta realtime
verb count_down(erg n: Int) -> Int {
    erg total: Int = n;
    for erg index: u32 in 0u32..4u32 {
        total = total + 1;
    }
    return total;
}

verb main() {
}

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