E0073#
Warning name: unnecessary_annotation
Unnecessary type or package annotation.
MoonBit reports this warning when a type or package qualifier repeats information that is already known from context. Removing the qualifier keeps the code shorter without changing the meaning.
Erroneous example#
///|
priv struct Point {
x : Int
}
///|
fn make_point() -> Point {
Point::{ x: 1 }
}
///|
test {
inspect(make_point().x, content="1")
}
Suggestion#
Remove the redundant annotation.
///|
priv struct Point {
x : Int
}
///|
fn make_point() -> Point {
{ x: 1 }
}
///|
test {
inspect(make_point().x, content="1")
}