README

marianoguerra/wax/warning does not have a README file

#
Level

pub(all) enum Level {
Hidden
Displayed
ErrorLevel
} derive(Eq,
Debug
)

What to do with a warning when it is reported.

#
Policy

pub(all) struct Policy {
level : (Warning) -> Level
}

A mapping from each warning to its level.

A function rather than a table, so set returns an updated closure and later assignments naturally override earlier ones.

#
Policy::resolve

fn Policy::resolve(self : Policy, w : Warning) -> Level

#
Policy::set

fn Policy::set(self : Policy, target : String, level : Level) -> Result[Policy, String]

policy updated so target -- a warning name, a group, or all -- has level. Later calls override earlier ones.

#
Warning

pub(all) enum Warning {
UnusedLocal
UnusedField
UnusedImport
UnusedLabel
UnnecessaryMut
ShiftOverflow
ConstantTrap
TautologicalComparison
ConstantCondition
UnusedResult
DeadCode
CastAlwaysFails
EagerSelect
Precedence
RedundantOperation
TruncatedCoverage
NamingConflict
ReservedWordRename
GeneratedName
CompoundAssignment
FieldPunning
RedundantAnnotation
ConfusableUnicode
} derive(Eq,
Debug
)

A named warning.

#
Warning::description

fn Warning::description(self : Warning) -> String

A one-line description, for help text.

#
Warning::is_unnecessary

fn Warning::is_unnecessary(self : Warning) -> Bool

Whether this flags code removable with no change in behaviour.

An editor renders such a diagnostic faded -- LSP's DiagnosticTag.Unnecessary. Kept beside the definitions so every consumer classifies from one source.

#
Warning::name

fn Warning::name(self : Warning) -> String

The stable, hyphenated name.

#
all

let all : Array[Warning]

Every named warning.

#
default_policy

let default_policy : Policy

The level each warning has when nothing has configured it.

The from-wasm renaming warnings are noisy round-trip notices, and redundant-operation and the suggestion group are optimisation and style hints common in generated code -- all hidden unless -W asks for them. Everything else is shown.

#
groups

fn groups() -> Array[String]

The group names, for help text. Excludes the special all.

#
parse_spec

fn parse_spec(s : String) -> Result[(String, Level), String]

Parse a -W argument, NAME=LEVEL.

Powered by MoonBit

Site sourceReport issuePackagesBuild queueSkillsStatistics

© 2026 mooncakes.io