type Counter { value: i32, fn add(self: ref, amount: i32) -> i32 { return self.value + amount } } pub fn main() -> Void { let counter: Counter = Counter { value: 40 } expect (Counter.add(&counter, 2) == 42) }