rust/src/test/run-pass/nested-class.rs

15 lines
224 B
Rust
Raw Normal View History

fn main() {
class b {
let i: int;
fn do_stuff() -> int { ret 37; }
new(i:int) { self.i = i; }
}
// fn b(x:int) -> int { fail; }
let z = b(42);
assert(z.i == 42);
assert(z.do_stuff() == 37);
}