alias ByteCount = usize type Counter { value: i32, fn add(self: ref, amount: i32) -> i32 { return self.value + amount } } enum State { ready, done, } pub fn main() -> Void { let count: ByteCount = 42_usize let counter: Counter = Counter { value: 40 } let state: State = State.ready match state { ready { expect (Counter.add(&counter, 2) == 42) } _ { expect (count == 42_usize) } } }