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

error not-callable

error Стандарт: [§5.3]

Выражение нельзя вызвать.

What it means#

Only functions, closures, methods, type constructors and values of a type that declares op () can be called with (...) (§5.3, §6.1). Calling an integer, a string or a struct without a call operator is an error.

Example#

oxl✓ проверяется в CI
fn main() {
  let n = 5
  let m = n(2)      // <- not-callable
}
error
not-callable

How to fix#

oxl✓ проверяется в CI
fn main() {
  let n = 5
  let m = n * 2
}

Remove the call parentheses, or declare op () in an impl of the type if call syntax is intended.

See also#

OxL 1.0.0-beta · Версия документации 1.0.0-beta© OxwaldLink · сгенерировано из Стандарта, исходников std и руководства