E1131: call needs a capability that the caller does not declare

View source

meta capability("name") says that a verb needs a platform primitive, such as posix.cloexec (ADR-0096).

meta capability("name") says that a verb needs a platform primitive, such as posix.cloexec (ADR-0096). A verb that calls it needs the same primitive, so it must declare the same capability. Then the requirement stays visible up the call graph, and the target check of E1132 sees it. The error points at the call and names the callee and the capability.

Example

actus
meta capability("posix.cloexec")
verb primitive() -> Int {
    return 0;
}

verb caller() -> Int {
    return primitive();
}

verb main() {
}
toml
[package]
name = "example"
version = "0.1.0"
edition = "alpha"
entry = "main"

[build]
target = "x86_64-unknown-linux-gnu"
profile = "debug"
runtime = "std"

Fix

Declare the capability on the caller.

actus
meta capability("posix.cloexec")
verb primitive() -> Int {
    return 0;
}

meta capability("posix.cloexec")
verb caller() -> Int {
    return primitive();
}

verb main() {
}
toml
[package]
name = "example"
version = "0.1.0"
edition = "alpha"
entry = "main"

[build]
target = "x86_64-unknown-linux-gnu"
profile = "debug"
runtime = "std"

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