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

fn warn

Reports a diagnostic of the plugin's rule at at (its level comes from [lint], default warning).

Example:

oxl✓ проверяется в CI
use std.comptime { Decl, warn }

comptime fn long_names(d: Decl) {
  if d.name.len() > 40 {
    warn(d.span, "`{d.name}` is longer than 40 characters")
  }
}
@intrinsic("comptime.warn") pub(api) comptime fn warn(at: Span, message: str)

С версии. 1.0.0-beta

Параметры

ИмяТип
atSpan
messagestr

Ошибки

none; the rule's level (`warn`, `error` or `off`) decides whether the diagnostic stops the build.

Эффекты

не объявлены (чистая, пока тело не говорит иное)

Определено в: std/comptime/comptime.oxl:202

См. также