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

error it-outside-chain

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

it использован вне шага цепочки.

What it means#

The contextual word it denotes the value of the previous step, and exists only inside a step of a chain or pipeline (§8.4, §10.6). In a nested chain it refers to the innermost one; outside, it is an ordinary name and, if undefined, is rejected.

Example#

oxl✓ проверяется в CI
fn main() io {
  let y = it + 1      // <- it-outside-chain
  print("{y}")
}
error
it-outside-chain

How to fix#

oxl✓ проверяется в CI
service Users {
  @public rpc get(id: u64) -> User
}
data User { name: str }
impl Users {
  rpc get(id) { User{ name: "ann" } }
}

fn main() io, net {
  let y = await Users.get(1) -> it.name
  print("{y}")
}

Use it only inside a chain step, or name the value with a lambda (x => ...).

See also#

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