rust/src/test/run-pass/nested-class.rs
Tim Chevalier 76d6120e52 Fix resolve bug that made nested classes not work
It wasn't possible to refer to the constructor for a class nested inside
an item from the class's outer scope. Fixed.
2012-06-20 20:12:14 -07:00

15 lines
224 B
Rust

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);
}