navid/haze / 48ef02229ff0b40a4849e26fc1a9f371991f791d48bb426ffeb35dad068eb87d / 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)
    }
}