Skip to content
Playground(another site)

bynk.given.undeclared_capability

Error A handler uses a capability it did not declare with given.

A handler may only use a capability it has itself declared with given. Effects in Bynk are explicit: the given clause is the handler's honest, checkable statement of every capability it reaches for, so a reader (and the compiler) can see a handler's full reach from its signature alone. Using a capability that is not in given is the missing half of that contract.

Example

on call() -> Effect[()] by Caller {
Logger.log("hi") // ✗ uses Logger without declaring it
}
on call() -> Effect[()] by Caller given Logger { // ✓ declared, then used
Logger.log("hi")
}

In the Book

See also