cairo-native 0.9.0-rc.8

A compiler to convert Cairo's IR Sierra code to MLIR and execute it.
1
2
3
4
5
6
7
8
9
10
11
12
use core::nullable::{match_nullable, FromNullableResult};

fn main(x: Nullable<bool>) -> felt252 {
    match match_nullable(x) {
        FromNullableResult::Null(()) => 100,
        FromNullableResult::NotNull(x) => if x.unbox() {
            1
        } else {
            0
        },
    }
}