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

error bad-allow

error Стандарт: [III.4]

Неверный @allow(lint: …): причина обязательна.

What it means#

@allow(lint: <rule>, reason: "...") silences one analyzer rule for the declaration that carries it. Both arguments are required: lint is a rule name (scatter-gather, written as an identifier with hyphens or as a string) and reason a non-empty string literal. Only rules that report warnings can be suppressed; a rule whose diagnostics are errors cannot. (@allow(role: …) on an rpc is the access rule of §13.4 and is a different attribute form.)

Example#

oxl✓ проверяется в CI
@allow(lint: magic-literal)       // <- bad-allow
fn pause() time { sleep(20ms) }
error
bad-allow

How to fix#

Give the reason, and name a rule that reports warnings.

oxl✓ проверяется в CI
@allow(lint: magic-literal, reason: "tuned together with wait()")
fn pause() time { sleep(20ms) }

See also#

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