OxL Reference

error missing-annotation

error Standard: [§3]

What it means#

Parameter types and return types of pub and pub(api) functions MUST be written out (§3). Only private functions may omit the return type and let it be inferred from a body of the form => e.

Example#

oxl✓ checked in CI
pub fn add(a: i32, b: i32) => a + b      // <- missing-annotation (no return type)
error
missing-annotation

How to fix#

oxl✓ checked in CI
pub fn add(a: i32, b: i32) -> i32 => a + b

Write the return type (and parameter types) explicitly. For pub(api) functions effects must be declared as well (effects).

See also#

OxL 1.0.0-beta · Documentation version 1.0.0-beta© OxwaldLink · generated from the Standard, the std sources and the guides