E1000: expected top-level binding
Generated from rellum-diagnostics/src/db.rs.
Explanation
A module body can contain imports followed by type, enum, function, event, graph, state, request, effect wrapper, and effect bindings. Any other token at top level does not start a valid item.
Common causes
- placing an expression directly at top level
- starting a binding with punctuation or a keyword that is not valid at item position
- leaving a partial statement after deleting a binding name
Canonical fixes
- wrap top-level work in a binding
Before:
print!("ready")
After:
main! = print!("ready")
- move expression-only code into a function, graph, or effect binding
Code example
print!("ready")