cairo-native 0.9.0-rc.3

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
13
14
15
16
17
trait MyTrait<T> {
    fn foo(t: T) -> T {
        t
    }
}
impl MyImplU64 of MyTrait<u64>;
impl MyImplU32 of MyTrait<u32> {
    fn foo(t: u32) -> u32 {
        t + 1
    }
}

#[test]
fn test_default_implementation_and_override() {
    assert!(MyTrait::foo(5_u64) == 5);
    assert!(MyTrait::foo(10_u32) == 11);
}