navid/haze / 94d8e2a026845bd62732f6eb7c222b5a9c18a60511c534c648cee6fd4b471090 / samples/baseline_2.7/is_wrong_pattern_error.hz

is_wrong_pattern_error.hz

← samples/baseline_2.7 · 172 bytes · raw · download

// The is-pattern must match the scrutinee type.

fn maybe() Option[i32] => Some(1)

fn main() {
    const value = maybe()
    if value is OK(v) {
        print(v)
    }
}