E3009#
A record pattern cannot contain only ... Use the wildcard pattern _ instead.
Erroneous example#
///|
struct Point {
x : Int
y : Int
}
///|
fn process_point(p : Point) -> Unit {
match p {
{ .. } => println("Got a point")
//^~~~~~
// Error: Struct pattern cannot contain only `..`, use wildcard pattern `_` instead.
}
}
Suggestion#
Use the wildcard pattern _ instead of { .. }:
You can also use { .. } along with other fields if you want to match specific fields: