S0026: effect expression must be an effect call
Generated from rellum-diagnostics/src/db.rs.
Explanation
The body of an effect binding is Fire-phase code. It must be an effect call or a -> chain of effect calls so the compiler can collect the exact runtime effects and check resource conflicts before execution.
Common causes
- returning a pure value from a main! or other ! binding
- using match or arithmetic directly as an effect body
- placing local computation in Fire instead of Derive
Canonical fixes
- wrap the computed value in an effect call
Before:
main! = value
After:
main! = print!(value)
- compute the value in a = binding, then use it from an effect
Before:
main! = len(history)
After:
count = len(history)
main! = print!(count)
- sequence multiple effect calls with ->
Before:
main! = print!(value)
write!("build/out.txt", value)
After:
main! = print!(value) -> write!("build/out.txt", value)
Code example
main! = value