OxL Справочник OxL
РусскийEnglish

error missing-annotation

error Стандарт: [§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✓ проверяется в CI
pub fn add(a: i32, b: i32) => a + b      // <- missing-annotation (no return type)
error
missing-annotation

How to fix#

oxl✓ проверяется в 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 · Версия документации 1.0.0-beta© OxwaldLink · сгенерировано из Стандарта, исходников std и руководства