E0014#
Warning name: alert or alert_<category>
Alert warnings are emitted when code uses an API that carries an alert, for
example through #alert, #internal, or
a visibility-change annotation. The alert category is chosen by the API
provider, so the warning name can be alert for all alerts or
alert_<category> for one category.
Erroneous example#
The provider module marks experimental as internal, and the importing module
calls it:
provider/top.mbt#
///|
#internal(experimental, "use stable instead")
pub fn experimental() -> Int {
1
}
top.mbt#
///|
test {
inspect(@provider.experimental(), content="1")
}
Suggestion#
Read the alert category and message, then follow the guidance for that specific API. Different alert categories can mean different things: an API may be experimental, deprecated, visibility-changing, unsafe, not total, or carry a provider-defined meaning.
In this example, the provider asks callers to use the stable API instead:
provider/top.mbt#
///|
pub fn stable() -> Int {
1
}
top.mbt#
///|
test {
inspect(@provider.stable(), content="1")
}