E3026#
A with pattern is only allowed immediately under an or-pattern.
Erroneous example#
///|
pub fn value_or_zero(value : Int?) -> Int {
match value {
(None with result = 0) => result
Some(result) => result
}
}
Suggestion#
Combine the alternative that supplies defaults with another pattern using |.
///|
pub fn value_or_zero(value : Int?) -> Int {
match value {
Some(result) | (None with result = 0) => result
}
}